| CMakeLists.txt |
|
1442 |
- |
| doc |
|
|
- |
| qcoapclient.cpp |
!
\class QCoapClient
\inmodule QtCoap
\brief The QCoapClient class allows the application to
send CoAP requests and receive replies.
\reentrant
The QCoapClient class contains signals that get triggered when the
reply of a sent request has arrived.
The application can use a QCoapClient to send requests over a CoAP
network. It provides functions for standard requests: each returns a QCoapReply object,
to which the response data shall be delivered; this can be read when the finished()
signal arrives.
A simple request can be sent with:
\code
QCoapClient *client = new QCoapClient(this);
connect(client, &QCoapClient::finished, this, &TestClass::slotFinished);
client->get(QCoapRequest(Qurl("coap://coap.me/test")));
\endcode
\note After processing of the request has finished, it is the responsibility
of the user to delete the QCoapReply object at an appropriate time. Do not
directly delete it inside the slot connected to finished(). You can use the
deleteLater() function.
You can also use an \e observe request. This can be used as above, or more
conveniently with the QCoapReply::notified() signal:
\code
QCoapRequest request = QCoapRequest(Qurl("coap://coap.me/obs"));
QCoapReply *reply = client->observe(request);
connect(reply, &QCoapReply::notified, this, &TestClass::slotNotified);
\endcode
And the observation can be cancelled with:
\code
client->cancelObserve(reply);
\endcode
When a reply arrives, the QCoapClient emits a finished() signal.
\note For a discovery request, the returned object is a QCoapResourceDiscoveryReply.
It can be used the same way as a QCoapReply but contains also a list of
resources.
\section1 Security Considerations
During a block-wise transfer, the response payload is accumulated
in memory until the transfer completes, and QtCoap does not impose an upper
bound on the accumulated size. A malicious or malfunctioning server that
keeps sending blocks without ever signalling the final one can therefore
drive the client to exhaust memory. The accumulated size is not observable while
the transfer is in progress, so an application cannot bound it directly. Perform
block-wise exchanges only with trusted servers, and preferably on a trusted or
isolated network.
\section2 Multicast
DTLS protects a connection between two endpoints and therefore cannot apply to
multicast, where more than 2 endpoints may be present. Because of this, a
multicast request and its replies are neither encrypted nor authenticated.
Every host in the group may answer a multicast request. In CoAP these hosts
are all legitimate owners of the resource and are expected to serve
equivalent replies. When a reply is sent block by block, the remaining
blocks are retrieved by unicast from whichever host answered.
CoAP multicast is designed with the assumption that the network is secured
and every node in the group is trusted. Use multicast only in scenarios that
fulfill this assumption.
\sa QCoapRequest, QCoapReply, QCoapResourceDiscoveryReply
|
26386 |
- |
| qcoapclient.h |
|
3490 |
- |
| qcoapclient_p.h |
|
1312 |
- |
| qcoapconnection.cpp |
!
\internal
\class QCoapConnection
\inmodule QtCoap
\brief The QCoapConnection class defines an interface for
handling transfers of frames to a server.
It isolates CoAP clients from the transport in use, so that any
client can be used with any supported transport.
\note A subclass that implements a transport is responsible for the security
of the connection it establishes. Unless the transport itself provides
encryption, peer authentication, and correct message framing, the
confidentiality, integrity, and authenticity guarantees that DTLS provides
over the default transport no longer hold. See the security discussion in the
\l(Qt CoAP Overview#Security){Qt CoAP Overview}.
|
7505 |
- |
| qcoapconnection_p.h |
|
3057 |
- |
| qcoapglobal.h |
|
453 |
- |
| qcoapinternalmessage.cpp |
!
\internal
Destructor of the private class.
|
5554 |
- |
| qcoapinternalmessage_p.h |
|
1973 |
- |
| qcoapinternalreply.cpp |
!
\internal
\class QCoapInternalReply
\brief The QCoapInternalReply class contains data related to
a received message.
It is a subclass of QCoapInternalMessage.
\reentrant
\sa QCoapInternalMessage, QCoapInternalRequest
|
8427 |
- |
| qcoapinternalreply_p.h |
|
1669 |
- |
| qcoapinternalrequest.cpp |
!
\internal
\class QCoapInternalRequest
\brief The QCoapInternalRequest class contains data related to
a message that needs to be sent.
\reentrant
\sa QCoapInternalMessage, QCoapInternalReply
|
18932 |
- |
| qcoapinternalrequest_p.h |
|
3318 |
- |
| qcoapmessage.cpp |
!
\class QCoapMessage
\inmodule QtCoap
\brief The QCoapMessage class holds information about a CoAP message that
can be a request or a reply.
\reentrant
It holds information such as the message type, message id, token and other
ancillary data.
\sa QCoapOption, QCoapReply, QCoapRequest
|
9355 |
- |
| qcoapmessage.h |
|
2324 |
- |
| qcoapmessage_p.h |
|
1495 |
- |
| qcoapnamespace.cpp |
!
\namespace QtCoap
\inmodule QtCoap
\brief Contains miscellaneous identifiers used throughout the Qt CoAP module.
\keyword {QtCoap Namespace}
|
13168 |
- |
| qcoapnamespace.h |
|
2653 |
- |
| qcoapnamespace_p.h |
|
934 |
- |
| qcoapoption.cpp |
!
\class QCoapOption
\inmodule QtCoap
\brief The QCoapOption class holds data about CoAP options.
\reentrant
CoAP defines a number of options that can be included in a message.
Both requests and responses may include a list of one or more
options. For example, the URI in a request is transported in several
options, and metadata that would be carried in an HTTP header in HTTP
is supplied as options as well.
An option contains a name, related to an option ID, and a value.
The name is one of the values from the OptionName enumeration.
|
8593 |
- |
| qcoapoption.h |
|
2113 |
- |
| qcoapoption_p.h |
|
911 |
- |
| qcoapprotocol.cpp |
!
\internal
\class QCoapProtocol
\inmodule QtCoap
\brief The QCoapProtocol class handles the logical part of the CoAP
protocol.
\reentrant
The QCoapProtocol is used by the QCoapClient class to handle the logical
part of the protocol. It can encode requests and decode replies. It also
handles what to do when a message is received, along with retransmission of
lost messages.
\sa QCoapClient
|
35330 |
- |
| qcoapprotocol_p.h |
|
5232 |
- |
| qcoapqudpconnection.cpp |
!
\internal
\class QCoapQUdpConnection
\inmodule QtCoap
\brief The QCoapQUdpConnection class handles the transfer of frames to
and from a server.
\reentrant
The QCoapQUdpConnection class is used by the QCoapClient class to send
requests to a server. It has a socket listening for UDP messages,
that is used to send the CoAP frames.
When a reply is available, the QCoapQUdpConnection object emits a readyRead()
signal.
\sa QCoapClient
|
14680 |
- |
| qcoapqudpconnection_p.h |
|
2644 |
- |
| qcoapreply.cpp |
!
\internal
Constructor.
|
9124 |
- |
| qcoapreply.h |
|
2047 |
- |
| qcoapreply_p.h |
|
1562 |
- |
| qcoaprequest.cpp |
!
\internal
\brief Sets the url after adjusting it, and asserting its validity.
|
7442 |
- |
| qcoaprequest.h |
|
1446 |
- |
| qcoaprequest_p.h |
|
1507 |
- |
| qcoapresource.cpp |
!
\class QCoapResource
\inmodule QtCoap
\brief The QCoapResource class holds information about a discovered
resource.
\reentrant
The QCoapRequest contains data as the path and title of the resource
and other ancillary information.
\sa QCoapResourceDiscoveryReply
|
5087 |
- |
| qcoapresource.h |
|
1412 |
- |
| qcoapresource_p.h |
|
1423 |
- |
| qcoapresourcediscoveryreply.cpp |
!
\internal
Updates the QCoapResourceDiscoveryReply object, its message and list of resources
with data of the internal reply \a internalReply.
|
4834 |
- |
| qcoapresourcediscoveryreply.h |
|
918 |
- |
| qcoapresourcediscoveryreply_p.h |
|
1227 |
- |
| qcoapsecurityconfiguration.cpp |
!
\class QCoapPrivateKey
\inmodule QtCoap
\brief The QCoapPrivateKey class provides an interface for managing
CoAP security keys.
A QCoapPrivateKey packages a private key used in negotiating CoAP connections
securely. It holds the information required for authentication using
\c pre-shared keys and X.509 certificates.
\section1 Security Considerations
QCoapPrivateKey stores the private key and its passphrase internally using
general-purpose data types (QByteArray) that do not guarantee secure erasure
of their contents from memory on destruction. This material may persist in
freed heap pages, core dumps, swap files, or process memory after a
QCoapPrivateKey object is destroyed or cleared. Because QByteArray is
implicitly shared, copies of the key or passphrase may exist in several
locations and cannot be wiped deterministically.
Where the security back-end supports it, constructing the key from a native
handle (the \c{Qt::HANDLE} overload) keeps the key material outside Qt's
general-purpose containers. Applications with strict requirements for
credential hygiene should take this into account when deciding how and where
to use QCoapPrivateKey.
|
10311 |
- |
| qcoapsecurityconfiguration.h |
|
2888 |
- |