ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
xmpp.h File Reference

The XMPP stanza codec (RFC 6120 sec 8): four builders, an escape, and two start-tag reads. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

The XMPP stanza codec (RFC 6120 sec 8): four builders, an escape, and two start-tag reads.

RFC 6120 sec 4.2 opens an XML stream by sending an initial stream header, and RFC 6120 sec 8 carries three stanza kinds over that stream: <message/> (sec 8.2.1), <presence/> (sec 8.2.2) and <iq/> (sec 8.2.3). This module builds those four elements into a caller buffer and reads two things back out of a received one: the start-tag Name, and one attribute value.

RFC 6120 sec 8.1 names the common attributes a stanza carries: 'to' (sec 8.1.1), 'from' (sec 8.1.2), 'id' (sec 8.1.3) and 'type' (sec 8.1.4). Each stanza kind takes its own 'type' values: message takes chat, error, groupchat, headline or normal (RFC 6121 sec 5.2.2); presence takes error, probe, subscribe, subscribed, unavailable, unsubscribe or unsubscribed, and its absence signals available (RFC 6121 sec 4.7.1); IQ takes get, set, result or error (RFC 6120 sec 8.2.3).

Character data and attribute values are written through the five predefined entities of XML 1.0 (W3C REC-xml Fifth Edition sec 4.6: amp, lt, gt, apos, quot). XML is a W3C Recommendation, not an IETF RFC; RFC 6120 sec 11.1 is what makes those five the only entity references an XMPP stream may carry.

The builders emit the members they are given and check nothing else. RFC 6120 sec 8.2.3 makes 'id' and 'type' REQUIRED on an IQ, and sec 8.4 requires one extension element on a get or a set; a caller that leaves those members NULL gets a stanza without them.

A 'to' or 'from' value is a JID (RFC 7622 sec 3.1, which obsoletes RFC 6122). The text is copied through escaped, without the PRECIS preparation or the 1023-octet part limits of RFC 7622 sec 3.2 through sec 3.4.

STARTTLS (RFC 6120 sec 5), SASL (RFC 6120 sec 6) and resource binding (RFC 6120 sec 7) are negotiated elsewhere; this module frames text and holds no stream.

The module exports one symbol, Xmpp. Everything in xmpp.c has internal linkage.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file xmpp.h.