|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
AMQP 0-9-1 wire-level framing (PROTOCORE_ENABLE_AMQP): the frames a client builds and the frames it reads back, into and out of caller buffers. More...
#include "protocore_config.h"Go to the source code of this file.
AMQP 0-9-1 wire-level framing (PROTOCORE_ENABLE_AMQP): the frames a client builds and the frames it reads back, into and out of caller buffers.
The governing document is not an IETF RFC. It is "AMQP, Advanced Message Queuing Protocol, Protocol Specification, Version 0-9-1, 13 November 2008", published by the AMQP Working Group. Every section number below is that document's. AMQP 1.0 is a separate OASIS Standard (OASIS Advanced Message Queuing Protocol (AMQP) Version 1.0 Part 2: Transport, OASIS Standard, 29 October 2012) whose frame carries an 8 octet fixed header and no frame-end octet; nothing here speaks it.
Sec 4.2.2, the 8 octets a client opens the connection with:
Sec 2.3.5 and sec 4.2.3, every frame after it, the size field counting the payload alone:
with type an octet, channel and size held high byte first (sec 4.2.5.1 holds every integer in network byte order), and frame-end = xCE (sec 4.2.1). Sec 4.2.3 states the frame-end octet MUST always be xCE and that a peer MUST check it before decoding the frame, which is the check ::AmqpNs::parse_frame makes.
Sec 4.2.3 names the four frame types METHOD, HEADER, BODY and HEARTBEAT. Its prose gives HEARTBEAT as type 4, while the sec 4.2.1 grammar reads heartbeat = d8 d0 d0 frame-end and the specification's own constant table reads frame-heartbeat = 8. AMQP_FRAME_HEARTBEAT takes 8.
A method payload is class-id(2) method-id(2) then the method's arguments (sec 2.3.5.1, sec 4.2.4). A content header payload is class-id(2) weight(2) body-size(8) property-flags(2) then the property list (sec 4.2.6.1), the weight field unused and zero, the body size the sum of the body sizes of the content body frames that follow. A heartbeat carries channel 0 and an empty payload (sec 4.2.7).
The arguments in a method payload and the property list in a content header are the application's octets; this module frames them and validates the framing.
The module exports one symbol, Amqp. Everything in amqp.c has internal linkage.
Definition in file amqp.h.