You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2018/04/05 19:34:12 UTC
[37/51] [partial] qpid-proton git commit: PROTON-1728: Reorganize the
source tree
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/core/transport.h
----------------------------------------------------------------------
diff --git a/c/src/core/transport.h b/c/src/core/transport.h
new file mode 100644
index 0000000..66ebc51
--- /dev/null
+++ b/c/src/core/transport.h
@@ -0,0 +1,31 @@
+#ifndef _PROTON_TRANSPORT_INTERNAL_H
+#define _PROTON_TRANSPORT_INTERNAL_H 1
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next);
+void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery);
+void pn_delivery_map_free(pn_delivery_map_t *db);
+void pn_unmap_handle(pn_session_t *ssn, pn_link_t *link);
+void pn_unmap_channel(pn_transport_t *transport, pn_session_t *ssn);
+
+#endif /* transport.h */
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/core/types.c
----------------------------------------------------------------------
diff --git a/c/src/core/types.c b/c/src/core/types.c
new file mode 100644
index 0000000..dbd18d0
--- /dev/null
+++ b/c/src/core/types.c
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/types.h>
+
+pn_bytes_t pn_bytes(size_t size, const char *start)
+{
+ pn_bytes_t bytes = {size, start};
+ return bytes;
+}
+
+pn_rwbytes_t pn_rwbytes(size_t size, char *start)
+{
+ pn_rwbytes_t bytes = {size, start};
+ return bytes;
+}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/core/util.c
----------------------------------------------------------------------
diff --git a/c/src/core/util.c b/c/src/core/util.c
new file mode 100644
index 0000000..a676e9f
--- /dev/null
+++ b/c/src/core/util.c
@@ -0,0 +1,169 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "util.h"
+
+#include "buffer.h"
+
+#include <proton/error.h>
+#include <proton/types.h>
+#include <proton/type_compat.h>
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+
+ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size)
+{
+ int idx = 0;
+ for (unsigned i = 0; i < size; i++)
+ {
+ uint8_t c = src[i];
+ if (isprint(c)) {
+ if (idx < (int) (capacity - 1)) {
+ dst[idx++] = c;
+ } else {
+ if (idx > 0) {
+ dst[idx - 1] = '\0';
+ }
+ return PN_OVERFLOW;
+ }
+ } else {
+ if (idx < (int) (capacity - 4)) {
+ idx += sprintf(dst + idx, "\\x%.2x", c);
+ } else {
+ if (idx > 0) {
+ dst[idx - 1] = '\0';
+ }
+ return PN_OVERFLOW;
+ }
+ }
+ }
+
+ dst[idx] = '\0';
+ return idx;
+}
+
+int pn_quote(pn_string_t *dst, const char *src, size_t size)
+{
+ while (true) {
+ size_t str_size = pn_string_size(dst);
+ char *str = pn_string_buffer(dst) + str_size;
+ size_t capacity = pn_string_capacity(dst) - str_size;
+ ssize_t ssize = pn_quote_data(str, capacity, src, size);
+ if (ssize == PN_OVERFLOW) {
+ int err = pn_string_grow(dst, (str_size + capacity) ? 2*(str_size + capacity) : 16);
+ if (err) return err;
+ } else if (ssize >= 0) {
+ return pn_string_resize(dst, str_size + ssize);
+ } else {
+ return ssize;
+ }
+ }
+}
+
+void pn_fprint_data(FILE *stream, const char *bytes, size_t size)
+{
+ char buf[256];
+ ssize_t n = pn_quote_data(buf, 256, bytes, size);
+ if (n >= 0) {
+ fputs(buf, stream);
+ } else {
+ if (n == PN_OVERFLOW) {
+ fputs(buf, stream);
+ fputs("... (truncated)", stream);
+ }
+ else
+ fprintf(stderr, "pn_quote_data: %s\n", pn_code(n));
+ }
+}
+
+void pn_print_data(const char *bytes, size_t size)
+{
+ pn_fprint_data(stdout, bytes, size);
+}
+
+int pn_strcasecmp(const char *a, const char *b)
+{
+ int diff;
+ while (*b) {
+ char aa = *a++, bb = *b++;
+ diff = tolower(aa)-tolower(bb);
+ if ( diff!=0 ) return diff;
+ }
+ return *a;
+}
+
+int pn_strncasecmp(const char* a, const char* b, size_t len)
+{
+ int diff = 0;
+ while (*b && len > 0) {
+ char aa = *a++, bb = *b++;
+ diff = tolower(aa)-tolower(bb);
+ if ( diff!=0 ) return diff;
+ --len;
+ };
+ return len==0 ? diff : *a;
+}
+
+bool pn_env_bool(const char *name)
+{
+ char *v = getenv(name);
+ return v && (!pn_strcasecmp(v, "true") || !pn_strcasecmp(v, "1") ||
+ !pn_strcasecmp(v, "yes") || !pn_strcasecmp(v, "on"));
+}
+
+char *pn_strdup(const char *src)
+{
+ if (!src) return NULL;
+ char *dest = (char *) malloc(strlen(src)+1);
+ if (!dest) return NULL;
+ return strcpy(dest, src);
+}
+
+char *pn_strndup(const char *src, size_t n)
+{
+ if (src) {
+ unsigned size = 0;
+ for (const char *c = src; size < n && *c; c++) {
+ size++;
+ }
+
+ char *dest = (char *) malloc(size + 1);
+ if (!dest) return NULL;
+ strncpy(dest, src, pn_min(n, size));
+ dest[size] = '\0';
+ return dest;
+ } else {
+ return NULL;
+ }
+}
+
+// which timestamp will expire next, or zero if none set
+pn_timestamp_t pn_timestamp_min( pn_timestamp_t a, pn_timestamp_t b )
+{
+ if (a && b) return pn_min(a, b);
+ if (a) return a;
+ return b;
+}
+
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/core/util.h
----------------------------------------------------------------------
diff --git a/c/src/core/util.h b/c/src/core/util.h
new file mode 100644
index 0000000..78b1c4d
--- /dev/null
+++ b/c/src/core/util.h
@@ -0,0 +1,136 @@
+#ifndef _PROTON_SRC_UTIL_H
+#define _PROTON_SRC_UTIL_H 1
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "buffer.h"
+
+#include <errno.h>
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <proton/types.h>
+#include <proton/object.h>
+
+ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size);
+int pn_quote(pn_string_t *dst, const char *src, size_t size);
+void pn_fprint_data(FILE *stream, const char *bytes, size_t size);
+void pn_print_data(const char *bytes, size_t size);
+bool pn_env_bool(const char *name);
+pn_timestamp_t pn_timestamp_min(pn_timestamp_t a, pn_timestamp_t b);
+
+char *pn_strdup(const char *src);
+char *pn_strndup(const char *src, size_t n);
+int pn_strcasecmp(const char* a, const char* b);
+int pn_strncasecmp(const char* a, const char* b, size_t len);
+
+static inline bool pn_bytes_equal(const pn_bytes_t a, const pn_bytes_t b) {
+ return (a.size == b.size && !memcmp(a.start, b.start, a.size));
+}
+
+static inline pn_bytes_t pn_string_bytes(pn_string_t *s) {
+ return pn_bytes(pn_string_size(s), pn_string_get(s));
+}
+
+/* Create a literal bytes value, e.g. PN_BYTES_LITERAL(foo) == pn_bytes(3, "foo") */
+#define PN_BYTES_LITERAL(X) (pn_bytes(sizeof(#X)-1, #X))
+
+#define DIE_IFR(EXPR, STRERR) \
+ do { \
+ int __code__ = (EXPR); \
+ if (__code__) { \
+ fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__, \
+ #EXPR, STRERR(__code__), __code__); \
+ exit(-1); \
+ } \
+ } while (0)
+
+#define DIE_IFE(EXPR) \
+ do { \
+ if ((EXPR) == -1) { \
+ int __code__ = errno; \
+ fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__, \
+ #EXPR, strerror(__code__), __code__); \
+ exit(-1); \
+ } \
+ } while (0)
+
+
+#define LL_HEAD(ROOT, LIST) ((ROOT)-> LIST ## _head)
+#define LL_TAIL(ROOT, LIST) ((ROOT)-> LIST ## _tail)
+#define LL_ADD(ROOT, LIST, NODE) \
+ { \
+ (NODE)-> LIST ## _next = NULL; \
+ (NODE)-> LIST ## _prev = (ROOT)-> LIST ## _tail; \
+ if (LL_TAIL(ROOT, LIST)) \
+ LL_TAIL(ROOT, LIST)-> LIST ## _next = (NODE); \
+ LL_TAIL(ROOT, LIST) = (NODE); \
+ if (!LL_HEAD(ROOT, LIST)) LL_HEAD(ROOT, LIST) = (NODE); \
+ }
+
+#define LL_POP(ROOT, LIST, TYPE) \
+ { \
+ if (LL_HEAD(ROOT, LIST)) { \
+ TYPE *_old = LL_HEAD(ROOT, LIST); \
+ LL_HEAD(ROOT, LIST) = LL_HEAD(ROOT, LIST)-> LIST ## _next; \
+ _old-> LIST ## _next = NULL; \
+ if (_old == LL_TAIL(ROOT, LIST)) { \
+ LL_TAIL(ROOT, LIST) = NULL; \
+ } else { \
+ LL_HEAD(ROOT, LIST)-> LIST ## _prev = NULL; \
+ } \
+ } \
+ }
+
+#define LL_REMOVE(ROOT, LIST, NODE) \
+ { \
+ if ((NODE)-> LIST ## _prev) \
+ (NODE)-> LIST ## _prev-> LIST ## _next = (NODE)-> LIST ## _next; \
+ if ((NODE)-> LIST ## _next) \
+ (NODE)-> LIST ## _next-> LIST ## _prev = (NODE)-> LIST ## _prev; \
+ if ((NODE) == LL_HEAD(ROOT, LIST)) \
+ LL_HEAD(ROOT, LIST) = (NODE)-> LIST ## _next; \
+ if ((NODE) == LL_TAIL(ROOT, LIST)) \
+ LL_TAIL(ROOT, LIST) = (NODE)-> LIST ## _prev; \
+ }
+
+#define pn_min(X,Y) ((X) > (Y) ? (Y) : (X))
+#define pn_max(X,Y) ((X) < (Y) ? (Y) : (X))
+
+#define PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE) \
+ while ((CAPACITY) < (COUNT)) { \
+ (CAPACITY) = (CAPACITY) ? 2 * (CAPACITY) : 16; \
+ (ARRAY) = (TYPE *) realloc((ARRAY), (CAPACITY) * sizeof (TYPE)); \
+ } \
+
+#define PN_ENSUREZ(ARRAY, CAPACITY, COUNT, TYPE) \
+ { \
+ size_t _old_capacity = (CAPACITY); \
+ PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE); \
+ memset((ARRAY) + _old_capacity, 0, \
+ sizeof(TYPE)*((CAPACITY) - _old_capacity)); \
+ }
+
+#endif /* util.h */
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/encodings.h.py
----------------------------------------------------------------------
diff --git a/c/src/encodings.h.py b/c/src/encodings.h.py
new file mode 100644
index 0000000..9f08c6c
--- /dev/null
+++ b/c/src/encodings.h.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from __future__ import print_function
+import mllib, optparse, os, sys
+
+xml = os.path.join(os.path.dirname(__file__), "types.xml")
+doc = mllib.xml_parse(xml)
+
+print("/* generated from %s */" % xml)
+print("#ifndef _PROTON_ENCODINGS_H")
+print("#define _PROTON_ENCODINGS_H 1")
+print()
+print("#define PNE_DESCRIPTOR (0x00)")
+
+for enc in doc.query["amqp/section/type/encoding"]:
+ name = enc["@name"] or enc.parent["@name"]
+ # XXX: a bit hacky
+ if name == "ieee-754":
+ name = enc.parent["@name"]
+ cname = "PNE_" + name.replace("-", "_").upper()
+ print("#define %s%s(%s)" % (cname, " "*(20-len(cname)), enc["@code"]))
+
+print()
+print("#endif /* encodings.h */")
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/extra/url.c
----------------------------------------------------------------------
diff --git a/c/src/extra/url.c b/c/src/extra/url.c
new file mode 100644
index 0000000..c4aa48c
--- /dev/null
+++ b/c/src/extra/url.c
@@ -0,0 +1,270 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "core/util.h"
+#include "proton/url.h"
+#include "proton/object.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+static void pni_urldecode(const char *src, char *dst)
+{
+ const char *in = src;
+ char *out = dst;
+ while (*in != '\0')
+ {
+ if ('%' == *in)
+ {
+ if ((in[1] != '\0') && (in[2] != '\0'))
+ {
+ char esc[3];
+ esc[0] = in[1];
+ esc[1] = in[2];
+ esc[2] = '\0';
+ unsigned long d = strtoul(esc, NULL, 16);
+ *out = (char)d;
+ in += 3;
+ out++;
+ }
+ else
+ {
+ *out = *in;
+ in++;
+ out++;
+ }
+ }
+ else
+ {
+ *out = *in;
+ in++;
+ out++;
+ }
+ }
+ *out = '\0';
+}
+
+/* Not static - used by messenger.c */
+void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path)
+{
+ if (!url) return;
+ *scheme = *user = *pass = *host = *port = *path = NULL;
+
+ char *slash = strchr(url, '/');
+
+ if (slash && slash>url) {
+ char *scheme_end = strstr(slash-1, "://");
+
+ if (scheme_end && scheme_end<slash) {
+ *scheme_end = '\0';
+ *scheme = url;
+ url = scheme_end + 3;
+ slash = strchr(url, '/');
+ }
+ }
+
+ if (slash) {
+ *slash = '\0';
+ *path = slash + 1;
+ }
+
+ char *at = strchr(url, '@');
+ if (at) {
+ *at = '\0';
+ char *up = url;
+ *user = up;
+ url = at + 1;
+ char *colon = strchr(up, ':');
+ if (colon) {
+ *colon = '\0';
+ *pass = colon + 1;
+ }
+ }
+
+ *host = url;
+ char *open = (*url == '[') ? url : 0;
+ if (open) {
+ char *close = strchr(open, ']');
+ if (close) {
+ *host = open + 1;
+ *close = '\0';
+ url = close + 1;
+ }
+ }
+
+ char *colon = strrchr(url, ':'); /* Be flexible about unbracketed IPV6 literals like ::1:<port> */
+ if (colon) {
+ *colon = '\0';
+ *port = colon + 1;
+ }
+
+ if (*user) pni_urldecode(*user, *user);
+ if (*pass) pni_urldecode(*pass, *pass);
+}
+
+/** URL-encode src and append to dst. */
+static void pni_urlencode(pn_string_t *dst, const char* src) {
+ static const char *bad = "@:/";
+
+ if (!src) return;
+ const char *i = src;
+ const char *j = strpbrk(i, bad);
+ while (j) {
+ pn_string_addf(dst, "%.*s", (int)(j-i), i);
+ pn_string_addf(dst, "%%%02X", (int)*j);
+ i = j + 1;
+ j = strpbrk(i, bad);
+ }
+ pn_string_addf(dst, "%s", i);
+}
+
+struct pn_url_t {
+ char *scheme;
+ char *username;
+ char *password;
+ char *host;
+ char *port;
+ char *path;
+ pn_string_t *str;
+};
+
+/** Internal use only, returns the pn_string_t. Public function is pn_url_str() */
+static pn_string_t *pn_url_string(pn_url_t* url)
+{
+ pn_url_str(url); /* Make sure str is up to date */
+ return url->str;
+}
+
+static void pn_url_finalize(void *object)
+{
+ pn_url_t *url = (pn_url_t *) object;
+ pn_url_clear(url);
+ pn_free(url->str);
+}
+
+static uintptr_t pn_url_hashcode(void *object)
+{
+ pn_url_t *url = (pn_url_t *) object;
+ return pn_hashcode(pn_url_string(url));
+}
+
+static intptr_t pn_url_compare(void *oa, void *ob)
+{
+ pn_url_t *a = (pn_url_t *) oa;
+ pn_url_t *b = (pn_url_t *) ob;
+ return pn_compare(pn_url_string(a), pn_url_string(b));
+}
+
+
+static int pn_url_inspect(void *obj, pn_string_t *dst)
+{
+ pn_url_t *url = (pn_url_t *) obj;
+ int err = 0;
+ err = pn_string_addf(dst, "Url("); if (err) return err;
+ err = pn_inspect(pn_url_string(url), dst); if (err) return err;
+ return pn_string_addf(dst, ")");
+}
+
+#define pn_url_initialize NULL
+
+
+pn_url_t *pn_url() {
+ static const pn_class_t clazz = PN_CLASS(pn_url);
+ pn_url_t *url = (pn_url_t*) pn_class_new(&clazz, sizeof(pn_url_t));
+ if (!url) return NULL;
+ memset(url, 0, sizeof(*url));
+ url->str = pn_string(NULL);
+ return url;
+}
+
+/** Parse a string URL as a pn_url_t.
+ *@param[in] url A URL string.
+ *@return The parsed pn_url_t or NULL if url is not a valid URL string.
+ */
+pn_url_t *pn_url_parse(const char *str) {
+ if (!str || !*str) /* Empty string or NULL is illegal. */
+ return NULL;
+
+ pn_url_t *url = pn_url();
+ char *str2 = pn_strdup(str);
+ pni_parse_url(str2, &url->scheme, &url->username, &url->password, &url->host, &url->port, &url->path);
+ url->scheme = pn_strdup(url->scheme);
+ url->username = pn_strdup(url->username);
+ url->password = pn_strdup(url->password);
+ url->host = (url->host && !*url->host) ? NULL : pn_strdup(url->host);
+ url->port = pn_strdup(url->port);
+ url->path = pn_strdup(url->path);
+
+ free(str2);
+ return url;
+}
+
+/** Free a URL */
+void pn_url_free(pn_url_t *url) { pn_free(url); }
+
+/** Clear the contents of the URL. */
+void pn_url_clear(pn_url_t *url) {
+ pn_url_set_scheme(url, NULL);
+ pn_url_set_username(url, NULL);
+ pn_url_set_password(url, NULL);
+ pn_url_set_host(url, NULL);
+ pn_url_set_port(url, NULL);
+ pn_url_set_path(url, NULL);
+ pn_string_clear(url->str);
+}
+
+/** Return the string form of a URL. */
+const char *pn_url_str(pn_url_t *url) {
+ if (pn_string_get(url->str) == NULL) {
+ pn_string_set(url->str, "");
+ if (url->scheme) pn_string_addf(url->str, "%s://", url->scheme);
+ if (url->username) pni_urlencode(url->str, url->username);
+ if (url->password) {
+ pn_string_addf(url->str, ":");
+ pni_urlencode(url->str, url->password);
+ }
+ if (url->username || url->password) pn_string_addf(url->str, "@");
+ if (url->host) {
+ if (strchr(url->host, ':')) pn_string_addf(url->str, "[%s]", url->host);
+ else pn_string_addf(url->str, "%s", url->host);
+ }
+ if (url->port) pn_string_addf(url->str, ":%s", url->port);
+ if (url->path) pn_string_addf(url->str, "/%s", url->path);
+ }
+ return pn_string_get(url->str);
+}
+
+const char *pn_url_get_scheme(pn_url_t *url) { return url->scheme; }
+const char *pn_url_get_username(pn_url_t *url) { return url->username; }
+const char *pn_url_get_password(pn_url_t *url) { return url->password; }
+const char *pn_url_get_host(pn_url_t *url) { return url->host; }
+const char *pn_url_get_port(pn_url_t *url) { return url->port; }
+const char *pn_url_get_path(pn_url_t *url) { return url->path; }
+
+#define SET(part) free(url->part); url->part = pn_strdup(part); pn_string_clear(url->str)
+void pn_url_set_scheme(pn_url_t *url, const char *scheme) { SET(scheme); }
+void pn_url_set_username(pn_url_t *url, const char *username) { SET(username); }
+void pn_url_set_password(pn_url_t *url, const char *password) { SET(password); }
+void pn_url_set_host(pn_url_t *url, const char *host) { SET(host); }
+void pn_url_set_port(pn_url_t *url, const char *port) { SET(port); }
+void pn_url_set_path(pn_url_t *url, const char *path) { SET(path); }
+
+
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/handlers/flowcontroller.c
----------------------------------------------------------------------
diff --git a/c/src/handlers/flowcontroller.c b/c/src/handlers/flowcontroller.c
new file mode 100644
index 0000000..d7cc3b9
--- /dev/null
+++ b/c/src/handlers/flowcontroller.c
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/link.h>
+#include <proton/handlers.h>
+#include <assert.h>
+
+typedef struct {
+ int window;
+ int drained;
+} pni_flowcontroller_t;
+
+pni_flowcontroller_t *pni_flowcontroller(pn_handler_t *handler) {
+ return (pni_flowcontroller_t *) pn_handler_mem(handler);
+}
+
+static void pni_topup(pn_link_t *link, int window) {
+ int delta = window - pn_link_credit(link);
+ pn_link_flow(link, delta);
+}
+
+static void pn_flowcontroller_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
+ pni_flowcontroller_t *fc = pni_flowcontroller(handler);
+ int window = fc->window;
+ pn_link_t *link = pn_event_link(event);
+
+ switch (pn_event_type(event)) {
+ case PN_LINK_LOCAL_OPEN:
+ case PN_LINK_REMOTE_OPEN:
+ case PN_LINK_FLOW:
+ case PN_DELIVERY:
+ if (pn_link_is_receiver(link)) {
+ fc->drained += pn_link_drained(link);
+ if (!fc->drained) {
+ pni_topup(link, window);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+pn_flowcontroller_t *pn_flowcontroller(int window) {
+ // XXX: a window of 1 doesn't work because we won't necessarily get
+ // notified when the one allowed delivery is settled
+ assert(window > 1);
+ pn_flowcontroller_t *handler = pn_handler_new(pn_flowcontroller_dispatch, sizeof(pni_flowcontroller_t), NULL);
+ pni_flowcontroller_t *fc = pni_flowcontroller(handler);
+ fc->window = window;
+ fc->drained = 0;
+ return handler;
+}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/handlers/handshaker.c
----------------------------------------------------------------------
diff --git a/c/src/handlers/handshaker.c b/c/src/handlers/handshaker.c
new file mode 100644
index 0000000..ea406c1
--- /dev/null
+++ b/c/src/handlers/handshaker.c
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/connection.h>
+#include <proton/session.h>
+#include <proton/link.h>
+#include <proton/handlers.h>
+#include <assert.h>
+
+typedef struct {
+ pn_map_t *handlers;
+} pni_handshaker_t;
+
+pni_handshaker_t *pni_handshaker(pn_handler_t *handler) {
+ return (pni_handshaker_t *) pn_handler_mem(handler);
+}
+
+static void pn_handshaker_finalize(pn_handler_t *handler) {
+ pni_handshaker_t *handshaker = pni_handshaker(handler);
+ pn_free(handshaker->handlers);
+}
+
+static void pn_handshaker_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
+ switch (type) {
+ case PN_CONNECTION_REMOTE_OPEN:
+ {
+ pn_connection_t *conn = pn_event_connection(event);
+ if (pn_connection_state(conn) & PN_LOCAL_UNINIT) {
+ pn_connection_open(conn);
+ }
+ }
+ break;
+ case PN_SESSION_REMOTE_OPEN:
+ {
+ pn_session_t *ssn = pn_event_session(event);
+ if (pn_session_state(ssn) & PN_LOCAL_UNINIT) {
+ pn_session_open(ssn);
+ }
+ }
+ break;
+ case PN_LINK_REMOTE_OPEN:
+ {
+ pn_link_t *link = pn_event_link(event);
+ if (pn_link_state(link) & PN_LOCAL_UNINIT) {
+ pn_terminus_copy(pn_link_source(link), pn_link_remote_source(link));
+ pn_terminus_copy(pn_link_target(link), pn_link_remote_target(link));
+ pn_link_open(link);
+ }
+ }
+ break;
+ case PN_CONNECTION_REMOTE_CLOSE:
+ {
+ pn_connection_t *conn = pn_event_connection(event);
+ if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) {
+ pn_connection_close(conn);
+ }
+ }
+ break;
+ case PN_SESSION_REMOTE_CLOSE:
+ {
+ pn_session_t *ssn = pn_event_session(event);
+ if (!(pn_session_state(ssn) & PN_LOCAL_CLOSED)) {
+ pn_session_close(ssn);
+ }
+ }
+ break;
+ case PN_LINK_REMOTE_CLOSE:
+ {
+ pn_link_t *link = pn_event_link(event);
+ if (!(pn_link_state(link) & PN_LOCAL_CLOSED)) {
+ pn_link_close(link);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+pn_handshaker_t *pn_handshaker(void) {
+ pn_handler_t *handler = pn_handler_new(pn_handshaker_dispatch, sizeof(pni_handshaker_t), pn_handshaker_finalize);
+ pni_handshaker_t *handshaker = pni_handshaker(handler);
+ handshaker->handlers = NULL;
+ return handler;
+}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/handlers/iohandler.c
----------------------------------------------------------------------
diff --git a/c/src/handlers/iohandler.c b/c/src/handlers/iohandler.c
new file mode 100644
index 0000000..db18c0c
--- /dev/null
+++ b/c/src/handlers/iohandler.c
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "reactor/io.h"
+#include "reactor/reactor.h"
+#include "reactor/selector.h"
+
+#include <proton/handlers.h>
+#include <proton/transport.h>
+#include <assert.h>
+
+static const char pni_selector_handle = 0;
+
+#define PN_SELECTOR ((pn_handle_t) &pni_selector_handle)
+
+void pni_handle_quiesced(pn_reactor_t *reactor, pn_selector_t *selector) {
+ // check if we are still quiesced, other handlers of
+ // PN_REACTOR_QUIESCED could have produced more events to process
+ if (!pn_reactor_quiesced(reactor)) { return; }
+ pn_selector_select(selector, pn_reactor_get_timeout(reactor));
+ pn_selectable_t *sel;
+ int events;
+ pn_reactor_mark(reactor);
+ while ((sel = pn_selector_next(selector, &events))) {
+ if (events & PN_READABLE) {
+ pn_selectable_readable(sel);
+ }
+ if (events & PN_WRITABLE) {
+ pn_selectable_writable(sel);
+ }
+ if (events & PN_EXPIRED) {
+ pn_selectable_expired(sel);
+ }
+ if (events & PN_ERROR) {
+ pn_selectable_error(sel);
+ }
+ }
+ pn_reactor_yield(reactor);
+}
+
+void pni_handle_transport(pn_reactor_t *reactor, pn_event_t *event);
+void pni_handle_open(pn_reactor_t *reactor, pn_event_t *event);
+void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event);
+
+static void pn_iodispatch(pn_iohandler_t *handler, pn_event_t *event, pn_event_type_t type) {
+ pn_reactor_t *reactor = pn_event_reactor(event);
+ pn_record_t *record = pn_reactor_attachments(reactor);
+ pn_selector_t *selector = (pn_selector_t *) pn_record_get(record, PN_SELECTOR);
+ if (!selector) {
+ selector = pn_io_selector(pni_reactor_io(reactor));
+ pn_record_def(record, PN_SELECTOR, PN_OBJECT);
+ pn_record_set(record, PN_SELECTOR, selector);
+ pn_decref(selector);
+ }
+ switch (type) {
+ case PN_SELECTABLE_INIT:
+ {
+ pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
+ pn_selector_add(selector, sel);
+ }
+ break;
+ case PN_SELECTABLE_UPDATED:
+ {
+ pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
+ pn_selector_update(selector, sel);
+ }
+ break;
+ case PN_SELECTABLE_FINAL:
+ {
+ pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
+ pn_selector_remove(selector, sel);
+ pn_selectable_release(sel);
+ }
+ break;
+ case PN_CONNECTION_LOCAL_OPEN:
+ pni_handle_open(reactor, event);
+ break;
+ case PN_CONNECTION_BOUND:
+ pni_handle_bound(reactor, event);
+ break;
+ case PN_TRANSPORT:
+ pni_handle_transport(reactor, event);
+ break;
+ case PN_TRANSPORT_CLOSED:
+ pn_transport_unbind(pn_event_transport(event));
+ break;
+ case PN_REACTOR_QUIESCED:
+ pni_handle_quiesced(reactor, selector);
+ break;
+ default:
+ break;
+ }
+}
+
+pn_iohandler_t *pn_iohandler(void) {
+ return pn_handler(pn_iodispatch);
+}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/libqpid-proton-core.pc.in
----------------------------------------------------------------------
diff --git a/c/src/libqpid-proton-core.pc.in b/c/src/libqpid-proton-core.pc.in
new file mode 100644
index 0000000..ff99108
--- /dev/null
+++ b/c/src/libqpid-proton-core.pc.in
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: Proton Core
+Description: Qpid Proton C core protocol library
+Version: @PN_VERSION@
+URL: http://qpid.apache.org/proton/
+Libs: -L${libdir} -lqpid-proton-core
+Cflags: -I${includedir}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/libqpid-proton-proactor.pc.in
----------------------------------------------------------------------
diff --git a/c/src/libqpid-proton-proactor.pc.in b/c/src/libqpid-proton-proactor.pc.in
new file mode 100644
index 0000000..c9f7ddb
--- /dev/null
+++ b/c/src/libqpid-proton-proactor.pc.in
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: Proton Proactor
+Description: Qpid Proton C proactive IO library
+Version: @PN_VERSION@
+URL: http://qpid.apache.org/proton/
+Libs: -L${libdir} -lqpid-proton-proactor
+Cflags: -I${includedir}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/libqpid-proton.pc.in
----------------------------------------------------------------------
diff --git a/c/src/libqpid-proton.pc.in b/c/src/libqpid-proton.pc.in
new file mode 100644
index 0000000..a045c3f
--- /dev/null
+++ b/c/src/libqpid-proton.pc.in
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: Proton
+Description: Qpid Proton C library
+Version: @PN_VERSION@
+URL: http://qpid.apache.org/proton/
+Libs: -L${libdir} -lqpid-proton
+Cflags: -I${includedir}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37136940/c/src/messaging.xml
----------------------------------------------------------------------
diff --git a/c/src/messaging.xml b/c/src/messaging.xml
new file mode 100644
index 0000000..1feb03b
--- /dev/null
+++ b/c/src/messaging.xml
@@ -0,0 +1,168 @@
+<?xml version="1.0"?>
+
+<!--
+Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
+Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
+Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
+Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
+Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
+Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
+Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. 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. The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+-->
+
+<amqp name="messaging" xmlns="http://www.amqp.org/schema/amqp.xsd">
+ <section name="message-format">
+ <type name="header" class="composite" source="list" provides="section">
+ <descriptor name="amqp:header:list" code="0x00000000:0x00000070"/>
+ <field name="durable" type="boolean" default="false"/>
+ <field name="priority" type="ubyte" default="4"/>
+ <field name="ttl" type="milliseconds"/>
+ <field name="first-acquirer" type="boolean" default="false"/>
+ <field name="delivery-count" type="uint" default="0"/>
+ </type>
+ <type name="delivery-annotations" class="restricted" source="annotations" provides="section">
+ <descriptor name="amqp:delivery-annotations:map" code="0x00000000:0x00000071"/>
+ </type>
+ <type name="message-annotations" class="restricted" source="annotations" provides="section">
+ <descriptor name="amqp:message-annotations:map" code="0x00000000:0x00000072"/>
+ </type>
+ <type name="properties" class="composite" source="list" provides="section">
+ <descriptor name="amqp:properties:list" code="0x00000000:0x00000073"/>
+ <field name="message-id" type="*" requires="message-id"/>
+ <field name="user-id" type="binary"/>
+ <field name="to" type="*" requires="address"/>
+ <field name="subject" type="string"/>
+ <field name="reply-to" type="*" requires="address"/>
+ <field name="correlation-id" type="*" requires="message-id"/>
+ <field name="content-type" type="symbol"/>
+ <field name="content-encoding" type="symbol"/>
+ <field name="absolute-expiry-time" type="timestamp"/>
+ <field name="creation-time" type="timestamp"/>
+ <field name="group-id" type="string"/>
+ <field name="group-sequence" type="sequence-no"/>
+ <field name="reply-to-group-id" type="string"/>
+ </type>
+ <type name="application-properties" class="restricted" source="map" provides="section">
+ <descriptor name="amqp:application-properties:map" code="0x00000000:0x00000074"/>
+ </type>
+ <type name="data" class="restricted" source="binary" provides="section">
+ <descriptor name="amqp:data:binary" code="0x00000000:0x00000075"/>
+ </type>
+ <type name="amqp-sequence" class="restricted" source="list" provides="section">
+ <descriptor name="amqp:amqp-sequence:list" code="0x00000000:0x00000076"/>
+ </type>
+ <type name="amqp-value" class="restricted" source="*" provides="section">
+ <descriptor name="amqp:amqp-value:*" code="0x00000000:0x00000077"/>
+ </type>
+ <type name="footer" class="restricted" source="annotations" provides="section">
+ <descriptor name="amqp:footer:map" code="0x00000000:0x00000078"/>
+ </type>
+ <type name="annotations" class="restricted" source="map"/>
+ <type name="message-id-ulong" class="restricted" source="ulong" provides="message-id"/>
+ <type name="message-id-uuid" class="restricted" source="uuid" provides="message-id"/>
+ <type name="message-id-binary" class="restricted" source="binary" provides="message-id"/>
+ <type name="message-id-string" class="restricted" source="string" provides="message-id"/>
+ <type name="address-string" class="restricted" source="string" provides="address"/>
+ <definition name="MESSAGE-FORMAT" value="0"/>
+ </section>
+ <section name="delivery-state">
+ <type name="received" class="composite" source="list" provides="delivery-state">
+ <descriptor name="amqp:received:list" code="0x00000000:0x00000023"/>
+ <field name="section-number" type="uint" mandatory="true"/>
+ <field name="section-offset" type="ulong" mandatory="true"/>
+ </type>
+ <type name="accepted" class="composite" source="list" provides="delivery-state, outcome">
+ <descriptor name="amqp:accepted:list" code="0x00000000:0x00000024"/>
+ </type>
+ <type name="rejected" class="composite" source="list" provides="delivery-state, outcome">
+ <descriptor name="amqp:rejected:list" code="0x00000000:0x00000025"/>
+ <field name="error" type="error"/>
+ </type>
+ <type name="released" class="composite" source="list" provides="delivery-state, outcome">
+ <descriptor name="amqp:released:list" code="0x00000000:0x00000026"/>
+ </type>
+ <type name="modified" class="composite" source="list" provides="delivery-state, outcome">
+ <descriptor name="amqp:modified:list" code="0x00000000:0x00000027"/>
+ <field name="delivery-failed" type="boolean"/>
+ <field name="undeliverable-here" type="boolean"/>
+ <field name="message-annotations" type="fields"/>
+ </type>
+ </section>
+ <section name="addressing">
+ <type name="source" class="composite" source="list" provides="source">
+ <descriptor name="amqp:source:list" code="0x00000000:0x00000028"/>
+ <field name="address" type="*" requires="address"/>
+ <field name="durable" type="terminus-durability" default="none"/>
+ <field name="expiry-policy" type="terminus-expiry-policy" default="session-end"/>
+ <field name="timeout" type="seconds" default="0"/>
+ <field name="dynamic" type="boolean" default="false"/>
+ <field name="dynamic-node-properties" type="node-properties"/>
+ <field name="distribution-mode" type="symbol" requires="distribution-mode"/>
+ <field name="filter" type="filter-set"/>
+ <field name="default-outcome" type="*" requires="outcome"/>
+ <field name="outcomes" type="symbol" multiple="true"/>
+ <field name="capabilities" type="symbol" multiple="true"/>
+ </type>
+ <type name="target" class="composite" source="list" provides="target">
+ <descriptor name="amqp:target:list" code="0x00000000:0x00000029"/>
+ <field name="address" type="*" requires="address"/>
+ <field name="durable" type="terminus-durability" default="none"/>
+ <field name="expiry-policy" type="terminus-expiry-policy" default="session-end"/>
+ <field name="timeout" type="seconds" default="0"/>
+ <field name="dynamic" type="boolean" default="false"/>
+ <field name="dynamic-node-properties" type="node-properties"/>
+ <field name="capabilities" type="symbol" multiple="true"/>
+ </type>
+ <type name="terminus-durability" class="restricted" source="uint">
+ <choice name="none" value="0"/>
+ <choice name="configuration" value="1"/>
+ <choice name="unsettled-state" value="2"/>
+ </type>
+ <type name="terminus-expiry-policy" class="restricted" source="symbol">
+ <choice name="link-detach" value="link-detach"/>
+ <choice name="session-end" value="session-end"/>
+ <choice name="connection-close" value="connection-close"/>
+ <choice name="never" value="never"/>
+ </type>
+ <type name="std-dist-mode" class="restricted" source="symbol" provides="distribution-mode">
+ <choice name="move" value="move"/>
+ <choice name="copy" value="copy"/>
+ </type>
+ <type name="filter-set" class="restricted" source="map"/>
+ <type name="node-properties" class="restricted" source="fields"/>
+ <type name="delete-on-close" class="composite" source="list" provides="lifetime-policy">
+ <descriptor name="amqp:delete-on-close:list" code="0x00000000:0x0000002b"/>
+ </type>
+ <type name="delete-on-no-links" class="composite" source="list" provides="lifetime-policy">
+ <descriptor name="amqp:delete-on-no-links:list" code="0x00000000:0x0000002c"/>
+ </type>
+ <type name="delete-on-no-messages" class="composite" source="list" provides="lifetime-policy">
+ <descriptor name="amqp:delete-on-no-messages:list" code="0x00000000:0x0000002d"/>
+ </type>
+ <type name="delete-on-no-links-or-messages" class="composite" source="list" provides="lifetime-policy">
+ <descriptor name="amqp:delete-on-no-links-or-messages:list" code="0x00000000:0x0000002e"/>
+ </type>
+ </section>
+</amqp>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org