proton  0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
engine.h
Go to the documentation of this file.
1 #ifndef PROTON_ENGINE_H
2 #define PROTON_ENGINE_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #ifndef __cplusplus
27 #include <stdbool.h>
28 #endif
29 #include <stddef.h>
30 #include <sys/types.h>
31 #include <proton/codec.h>
32 #include <proton/error.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /** @file
39  * API for the proton Engine.
40  *
41  * @todo
42  */
43 
45 typedef struct pn_connection_t pn_connection_t; /**< Connection */
46 typedef struct pn_session_t pn_session_t; /**< Session */
47 typedef struct pn_link_t pn_link_t; /**< Link */
50 
51 typedef enum {
53  PN_SOURCE = 1,
54  PN_TARGET = 2,
57 typedef enum {
62 typedef enum {
68 typedef enum {
73 typedef enum {
78 typedef enum {
79  PN_RCV_FIRST = 0, /**< implicitly settle rcvd xfers */
80  PN_RCV_SECOND = 1 /**< explicit disposition required */
82 
85 
86 typedef struct pn_delivery_tag_t {
87  size_t size;
88  const char *bytes;
90 
91 #ifndef SWIG // older versions of SWIG choke on this:
92 static inline pn_delivery_tag_t pn_dtag(const char *bytes, size_t size) {
93  pn_delivery_tag_t dtag = {size, bytes};
94  return dtag;
95 }
96 #endif
97 
98 typedef int pn_state_t; /**< encodes the state of an endpoint */
99 
100 #define PN_LOCAL_UNINIT (1) /**< local endpoint requires initialization */
101 #define PN_LOCAL_ACTIVE (2) /**< local endpoint is active */
102 #define PN_LOCAL_CLOSED (4) /**< local endpoint is closed */
103 #define PN_REMOTE_UNINIT (8) /**< remote endpoint pending initialization by peer */
104 #define PN_REMOTE_ACTIVE (16) /**< remote endpoint is active */
105 #define PN_REMOTE_CLOSED (32) /**< remote endpoint has closed */
106 
107 #define PN_LOCAL_MASK (PN_LOCAL_UNINIT | PN_LOCAL_ACTIVE | PN_LOCAL_CLOSED)
108 #define PN_REMOTE_MASK (PN_REMOTE_UNINIT | PN_REMOTE_ACTIVE | PN_REMOTE_CLOSED)
109 
110 /**
111  * The state/outcome of a message transfer.
112  *
113  * @todo document each value
114  */
115 
116 #define PN_RECEIVED (0x0000000000000023)
117 #define PN_ACCEPTED (0x0000000000000024)
118 #define PN_REJECTED (0x0000000000000025)
119 #define PN_RELEASED (0x0000000000000026)
120 #define PN_MODIFIED (0x0000000000000027)
121 
122 typedef int pn_trace_t;
123 typedef void (pn_tracer_t)(pn_transport_t *transport, const char *message);
124 
125 #define PN_TRACE_OFF (0)
126 #define PN_TRACE_RAW (1)
127 #define PN_TRACE_FRM (2)
128 #define PN_TRACE_DRV (4)
129 
130 // connection
131 
132 /** Factory to construct a new Connection.
133  *
134  * @return pointer to a new connection object.
135  */
137 
138 /** Retrieve the state of the connection.
139  *
140  * @param[in] connection the connection
141  * @return the connection's state flags
142  */
143 PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection);
144 /** @todo: needs documentation */
146 /** @todo: needs documentation */
147 PN_EXTERN const char *pn_connection_get_container(pn_connection_t *connection);
148 /** @todo: needs documentation */
149 PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container);
150 /** @todo: needs documentation */
151 PN_EXTERN const char *pn_connection_get_hostname(pn_connection_t *connection);
152 /** @todo: needs documentation */
153 PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname);
162 
163 
164 /** Extracts the first delivery on the connection that has pending
165  * operations.
166  *
167  * Retrieves the first delivery on the Connection that has pending
168  * operations. A readable delivery indicates message data is waiting
169  * to be read. A writable delivery indicates that message data may be
170  * sent. An updated delivery indicates that the delivery's disposition
171  * has changed. A delivery will never be both readable and writible,
172  * but it may be both readable and updated or both writiable and
173  * updated.
174  *
175  * @param[in] connection the connection
176  * @return the first delivery object that needs to be serviced, else
177  * NULL if none
178  */
180 
181 /** Get the next delivery on the connection that needs has pending
182  * operations.
183  *
184  * @param[in] delivery the previous delivery retrieved from
185  * either pn_work_head() or pn_work_next()
186  * @return the next delivery that has pending operations, else
187  * NULL if none
188  */
190 
191 /** Factory for creating a new session on the connection.
192  *
193  * A new session is created for the connection, and is added to the
194  * set of sessions maintained by the connection.
195  *
196  * @param[in] connection the session will exist over this connection
197  * @return pointer to new session
198  */
200 
202 PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *ssn, size_t capacity);
203 
206 
207 /** Factory for creating a transport.
208  *
209  * A transport to be used by a connection to interface with the
210  * network. There can only be one connection associated with a
211  * transport. See pn_transport_bind().
212  *
213  * @return pointer to new transport
214  */
216 
217 /** Binds the transport to an AMQP connection endpoint.
218  *
219  * @return an error code, or 0 on success
220  */
221 
222 PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection);
223 
225 
226 /** Retrieve the first Session that matches the given state mask.
227  *
228  * Examines the state of each session owned by the connection, and
229  * returns the first Session that matches the given state mask. If
230  * state contains both local and remote flags, then an exact match
231  * against those flags is performed. If state contains only local or
232  * only remote flags, then a match occurs if any of the local or
233  * remote flags are set respectively.
234  *
235  * @param[in] connection to be searched for matching sessions
236  * @param[in] state mask to match
237  * @return the first session owned by the connection that matches the
238  * mask, else NULL if no sessions match
239  */
240 PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state);
241 
242 /** Retrieve the next Session that matches the given state mask.
243  *
244  * When used with pn_session_head(), application can access all
245  * Sessions on the connection that match the given state. See
246  * pn_session_head() for description of match behavior.
247  *
248  * @param[in] session the previous session obtained from
249  * pn_session_head() or pn_session_next()
250  * @param[in] state mask to match.
251  * @return the next session owned by the connection that matches the
252  * mask, else NULL if no sessions match
253  */
254 PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state);
255 
256 /** Retrieve the first Link that matches the given state mask.
257  *
258  * Examines the state of each Link owned by the connection and returns
259  * the first Link that matches the given state mask. If state contains
260  * both local and remote flags, then an exact match against those
261  * flags is performed. If state contains only local or only remote
262  * flags, then a match occurs if any of the local or remote flags are
263  * set respectively.
264  *
265  * @param[in] connection to be searched for matching Links
266  * @param[in] state mask to match
267  * @return the first Link owned by the connection that matches the
268  * mask, else NULL if no Links match
269  */
270 PN_EXTERN pn_link_t *pn_link_head(pn_connection_t *connection, pn_state_t state);
271 
272 /** Retrieve the next Link that matches the given state mask.
273  *
274  * When used with pn_link_head(), the application can access all Links
275  * on the connection that match the given state. See pn_link_head()
276  * for description of match behavior.
277  *
278  * @param[in] link the previous Link obtained from pn_link_head() or
279  * pn_link_next()
280  * @param[in] state mask to match
281  * @return the next session owned by the connection that matches the
282  * mask, else NULL if no sessions match
283  */
284 PN_EXTERN pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state);
285 
290 
291 /** Access the application context that is associated with the
292  * connection.
293  *
294  * @param[in] connection the connection whose context is to be returned.
295  *
296  * @return the application context that was passed to pn_connection_set_context()
297  */
299 
300 /** Assign a new application context to the connection.
301  *
302  * @param[in] connection the connection which will hold the context.
303  * @param[in] context new application context to associate with the
304  * connection
305  */
306 PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context);
307 
308 
309 // transport
311 /* deprecated */
312 PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available);
313 /* deprecated */
314 PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size);
315 
316 /** Report the amount of free space for input following the
317  * transport's tail pointer. If the engine is in an exceptional state
318  * such as encountering an error condition or reaching the end of
319  * stream state, a negative value will be returned indicating the
320  * condition. If an error is indicated, futher details can be obtained
321  * from ::pn_transport_error. Calls to ::pn_transport_process may
322  * alter the value of this pointer. See ::pn_transport_process for
323  * details.
324  *
325  * @param[in] transport the transport
326  * @return the free space in the transport, PN_EOS or error code if < 0
327  */
329 
330 /** Return the transport's tail pointer. The amount of free space
331  * following this pointer is reported by ::pn_transport_capacity.
332  * Calls to ::pn_transport_process may alther the value of this
333  * pointer. See ::pn_transport_process for details.
334  *
335  * @param[in] transport the transport
336  * @return a pointer to the transport's input buffer, NULL if no capacity available.
337  */
338 PN_EXTERN char *pn_transport_tail(pn_transport_t *transport);
339 
340 /** Pushes the supplied bytes into the tail of the transport. This is
341  * equivalent to copying ::size bytes afther the tail pointer and then
342  * calling ::pn_transport_process with an argument of ::size. It is an
343  * error to call this with a size larger than the capacity reported by
344  * ::pn_transport_capacity.
345  *
346  * @param[in] transport the transport
347  * @return 0 on success, or error code if < 0
348  */
349 PN_EXTERN int pn_transport_push(pn_transport_t *transport, const char *src, size_t size);
350 
351 /** Process input data following the tail pointer. Calling this
352  * function will cause the transport to consume ::size bytes of input
353  * occupying the free space following the tail pointer. Calls to this
354  * function may change the value of ::pn_transport_tail, as well as
355  * the amount of free space reported by ::pn_transport_capacity.
356  *
357  * @param[in] transport the transport
358  * @param[size] the amount of data written to the transport's input buffer
359  * @return 0 on success, or error code if < 0
360  */
361 PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size);
362 
363 /** Indicate that the input has reached End Of Stream (EOS). This
364  * tells the transport that no more input will be forthcoming.
365  *
366  * @param[in] transport the transport
367  * @return 0 on success, or error code if < 0
368  */
370 
371 /** Report the number of pending output bytes following the
372  * transport's head pointer. If the engine is in an exceptional state
373  * such as encountering an error condition or reaching the end of
374  * stream state, a negative value will be returned indicating the
375  * condition. If an error is indicated, further details can be
376  * obtained from ::pn_transport_error. Calls to ::pn_transport_pop may
377  * alter the value of this pointer. See ::pn_transport_pop for
378  * details.
379  *
380  * @param[in] the transport
381  * @return the number of pending output bytes, or an error code
382  */
383 PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport);
384 
385 /** Return the transport's head pointer. This pointer references
386  * queued output data. The ::pn_transport_pending function reports how
387  * many bytes of output data follow this pointer. Calls to
388  * ::pn_transport_pop may alter this pointer and any data it
389  * references. See ::pn_transport_pop for details.
390  *
391  * @param[in] transport the transport
392  * @return a pointer to the transport's output buffer, or NULL if no pending output.
393  */
394 PN_EXTERN const char *pn_transport_head(pn_transport_t *transport);
395 
396 /** Copies ::size bytes from the head of the transport to the ::dst
397  * pointer. It is an error to call this with a value of ::size that is
398  * greater than the value reported by ::pn_transport_pending.
399  *
400  * @param[in] transport the transport
401  * @return 0 on success, or error code if < 0
402  */
403 PN_EXTERN int pn_transport_peek(pn_transport_t *transport, char *dst, size_t size);
404 
405 /** Removes ::size bytes of output from the pending output queue
406  * following the transport's head pointer. Calls to this function may
407  * alter the transport's head pointer as well as the number of pending
408  * bytes reported by ::pn_transport_pending.
409  *
410  * @param[in] the transport
411  * @param[size] the number of bytes to remove
412  */
413 PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size);
414 
415 /** Indicate that the output has closed. This tells the transport
416  * that no more output will be popped.
417  *
418  * @param[in] transport the transport
419  * @return 0 on success, or error code if < 0
420  */
422 
423 
424 /** Process any pending transport timer events.
425  *
426  * This method should be called after all pending input has been processed by the
427  * transport (see ::pn_transport_input), and before generating output (see
428  * ::pn_transport_output). It returns the deadline for the next pending timer event, if
429  * any are present.
430  *
431  * @param[in] transport the transport to process.
432  *
433  * @return if non-zero, then the expiration time of the next pending timer event for the
434  * transport. The caller must invoke pn_transport_tick again at least once at or before
435  * this deadline occurs.
436  */
438 PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace);
441 PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context);
443 PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message);
444 PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...);
445 // max frame of zero means "unlimited"
447 PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size);
449 /* timeout of zero means "no timeout" */
453 PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport);
454 PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport);
457 
458 // session
459 PN_EXTERN pn_state_t pn_session_state(pn_session_t *session);
462 PN_EXTERN void pn_session_open(pn_session_t *session);
464 PN_EXTERN void pn_session_free(pn_session_t *session);
466 PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context);
467 
468 // link
469 PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
470 PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
471 PN_EXTERN const char *pn_link_name(pn_link_t *link);
474 PN_EXTERN pn_state_t pn_link_state(pn_link_t *link);
493 
497 
498 PN_EXTERN void pn_link_open(pn_link_t *sender);
499 PN_EXTERN void pn_link_close(pn_link_t *sender);
500 PN_EXTERN void pn_link_free(pn_link_t *sender);
502 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
504 
505 // sender
506 PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
507 PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
508 PN_EXTERN int pn_link_drained(pn_link_t *sender);
509 //void pn_link_abort(pn_sender_t *sender);
510 
511 // receiver
512 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
513 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
514 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
515 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
516 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
517 
518 // terminus
521 
522 PN_EXTERN const char *pn_terminus_get_address(pn_terminus_t *terminus);
523 PN_EXTERN int pn_terminus_set_address(pn_terminus_t *terminus, const char *address);
526  pn_durability_t durability);
532 PN_EXTERN int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic);
540 
541 // delivery
545 // how do we do delivery state?
556 PN_EXTERN void pn_delivery_update(pn_delivery_t *delivery, uint64_t state);
558 //int pn_delivery_format(pn_delivery_t *delivery);
562 PN_EXTERN void pn_delivery_set_context(pn_delivery_t *delivery, void *context);
564 
565 // disposition
566 PN_EXTERN uint64_t pn_disposition_type(pn_disposition_t *disposition);
569 PN_EXTERN void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number);
571 PN_EXTERN void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset);
573 PN_EXTERN void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed);
575 PN_EXTERN void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable);
577 
578 // conditions
581 
584 
587 
589 
592 
593 PN_EXTERN const char *pn_condition_get_name(pn_condition_t *condition);
594 PN_EXTERN int pn_condition_set_name(pn_condition_t *condition, const char *name);
595 
597 PN_EXTERN int pn_condition_set_description(pn_condition_t *condition, const char *description);
598 
600 
602 PN_EXTERN const char *pn_condition_redirect_host(pn_condition_t *condition);
604 
605 #ifdef __cplusplus
606 }
607 #endif
608 
609 #endif /* engine.h */
PN_EXTERN pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link)
PN_EXTERN pn_condition_t * pn_session_condition(pn_session_t *session)
pn_durability_t
Definition: engine.h:57
PN_EXTERN pn_seconds_t pn_terminus_get_timeout(pn_terminus_t *terminus)
Definition: engine.h:66
Definition: engine.h:69
PN_EXTERN void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout)
Definition: engine.h:54
PN_EXTERN pn_data_t * pn_condition_info(pn_condition_t *condition)
PN_EXTERN void pn_session_close(pn_session_t *session)
uint32_t pn_millis_t
Definition: types.h:39
PN_EXTERN pn_terminus_t * pn_link_target(pn_link_t *link)
PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain)
PN_EXTERN pn_condition_t * pn_session_remote_condition(pn_session_t *session)
uint32_t pn_seconds_t
Definition: types.h:40
PN_EXTERN void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t)
PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message)
int pn_trace_t
Definition: engine.h:122
PN_EXTERN bool pn_delivery_buffered(pn_delivery_t *delivery)
struct pn_connection_t pn_connection_t
Connection.
Definition: engine.h:45
PN_EXTERN bool pn_delivery_partial(pn_delivery_t *delivery)
PN_EXTERN pn_data_t * pn_connection_offered_capabilities(pn_connection_t *connection)
const char * bytes
Definition: engine.h:88
PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size)
struct pn_delivery_tag_t pn_delivery_tag_t
PN_EXTERN int pn_transport_close_tail(pn_transport_t *transport)
Indicate that the input has reached End Of Stream (EOS).
PN_EXTERN pn_link_t * pn_delivery_link(pn_delivery_t *delivery)
PN_EXTERN pn_condition_t * pn_link_condition(pn_link_t *link)
PN_EXTERN bool pn_delivery_writable(pn_delivery_t *delivery)
PN_EXTERN bool pn_link_advance(pn_link_t *link)
pn_rcv_settle_mode_t
Definition: engine.h:78
PN_EXTERN uint64_t pn_disposition_get_section_offset(pn_disposition_t *disposition)
PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context)
struct pn_link_t pn_link_t
Link.
Definition: engine.h:47
PN_EXTERN pn_delivery_t * pn_unsettled_next(pn_delivery_t *delivery)
PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context)
Assign a new application context to the connection.
PN_EXTERN int pn_condition_redirect_port(pn_condition_t *condition)
PN_EXTERN pn_link_t * pn_link_next(pn_link_t *link, pn_state_t state)
Retrieve the next Link that matches the given state mask.
PN_EXTERN int pn_link_unsettled(pn_link_t *link)
PN_EXTERN void pn_delivery_clear(pn_delivery_t *delivery)
PN_EXTERN void pn_connection_reset(pn_connection_t *connection)
PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport)
Report the number of pending output bytes following the transport&#39;s head pointer. ...
PN_EXTERN int pn_condition_set_name(pn_condition_t *condition, const char *name)
struct pn_terminus_t pn_terminus_t
Definition: engine.h:48
PN_EXTERN pn_error_t * pn_session_error(pn_session_t *session)
PN_EXTERN pn_state_t pn_session_state(pn_session_t *session)
PN_EXTERN void pn_delivery_set_context(pn_delivery_t *delivery, void *context)
PN_EXTERN bool pn_delivery_updated(pn_delivery_t *delivery)
Definition: engine.h:60
PN_EXTERN bool pn_condition_is_redirect(pn_condition_t *condition)
PN_EXTERN int pn_link_drained(pn_link_t *sender)
Definition: engine.h:63
PN_EXTERN void pn_link_close(pn_link_t *sender)
PN_EXTERN pn_tracer_t * pn_transport_get_tracer(pn_transport_t *transport)
PN_EXTERN pn_condition_t * pn_connection_remote_condition(pn_connection_t *connection)
PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport)
PN_EXTERN pn_state_t pn_link_state(pn_link_t *link)
PN_EXTERN pn_session_t * pn_session_head(pn_connection_t *connection, pn_state_t state)
Retrieve the first Session that matches the given state mask.
PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size)
PN_EXTERN uint64_t pn_delivery_remote_state(pn_delivery_t *delivery)
PN_EXTERN pn_connection_t * pn_connection(void)
Factory to construct a new Connection.
PN_EXTERN void pn_link_open(pn_link_t *sender)
PN_EXTERN int pn_transport_unbind(pn_transport_t *transport)
PN_EXTERN pn_delivery_t * pn_unsettled_head(pn_link_t *link)
PN_EXTERN char * pn_transport_tail(pn_transport_t *transport)
Return the transport&#39;s tail pointer.
PN_EXTERN int pn_condition_set_description(pn_condition_t *condition, const char *description)
PN_EXTERN uint32_t pn_transport_get_max_frame(pn_transport_t *transport)
PN_EXTERN const char * pn_transport_head(pn_transport_t *transport)
Return the transport&#39;s head pointer.
PN_EXTERN bool pn_condition_is_set(pn_condition_t *condition)
PN_EXTERN const char * pn_connection_get_hostname(pn_connection_t *connection)
PN_EXTERN pn_link_t * pn_receiver(pn_session_t *session, const char *name)
PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport)
PN_EXTERN int pn_terminus_set_type(pn_terminus_t *terminus, pn_terminus_type_t type)
PN_EXTERN void * pn_transport_get_context(pn_transport_t *transport)
PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit)
PN_EXTERN pn_data_t * pn_connection_remote_offered_capabilities(pn_connection_t *connection)
PN_EXTERN pn_data_t * pn_disposition_annotations(pn_disposition_t *disposition)
PN_EXTERN void pn_delivery_settle(pn_delivery_t *delivery)
PN_EXTERN pn_connection_t * pn_session_connection(pn_session_t *session)
Definition: engine.h:65
PN_EXTERN ssize_t pn_transport_capacity(pn_transport_t *transport)
Report the amount of free space for input following the transport&#39;s tail pointer. ...
PN_EXTERN void * pn_link_get_context(pn_link_t *link)
pn_terminus_type_t
Definition: engine.h:51
PN_EXTERN int pn_terminus_set_durability(pn_terminus_t *terminus, pn_durability_t durability)
PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname)
PN_EXTERN uint64_t pn_delivery_local_state(pn_delivery_t *delivery)
PN_EXTERN pn_session_t * pn_session_next(pn_session_t *session, pn_state_t state)
Retrieve the next Session that matches the given state mask.
PN_EXTERN void pn_condition_clear(pn_condition_t *condition)
PN_EXTERN int pn_terminus_set_distribution_mode(pn_terminus_t *terminus, pn_distribution_mode_t m)
PN_EXTERN int pn_terminus_set_expiry_policy(pn_terminus_t *terminus, pn_expiry_policy_t policy)
PN_EXTERN void pn_connection_open(pn_connection_t *connection)
PN_EXTERN int pn_transport_push(pn_transport_t *transport, const char *src, size_t size)
Pushes the supplied bytes into the tail of the transport.
PN_EXTERN bool pn_disposition_is_undeliverable(pn_disposition_t *disposition)
PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace)
PN_EXTERN pn_delivery_t * pn_link_current(pn_link_t *link)
PN_EXTERN pn_disposition_t * pn_delivery_remote(pn_delivery_t *delivery)
PN_EXTERN void pn_connection_close(pn_connection_t *connection)
PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container)
PN_EXTERN pn_terminus_t * pn_link_source(pn_link_t *link)
PN_EXTERN const char * pn_connection_get_container(pn_connection_t *connection)
explicit disposition required
Definition: engine.h:80
Definition: engine.h:75
Definition: engine.h:71
Definition: engine.h:70
PN_EXTERN pn_data_t * pn_connection_remote_desired_capabilities(pn_connection_t *connection)
PN_EXTERN void pn_transport_free(pn_transport_t *transport)
PN_EXTERN size_t pn_delivery_pending(pn_delivery_t *delivery)
PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n)
struct pn_error_t pn_error_t
Definition: error.h:32
PN_EXTERN int pn_link_available(pn_link_t *link)
PN_EXTERN pn_delivery_t * pn_work_head(pn_connection_t *connection)
Extracts the first delivery on the connection that has pending operations.
PN_EXTERN int pn_transport_peek(pn_transport_t *transport, char *dst, size_t size)
Copies ::size bytes from the head of the transport to the ::dst pointer.
Definition: engine.h:59
PN_EXTERN pn_error_t * pn_connection_error(pn_connection_t *connection)
PN_EXTERN void pn_link_free(pn_link_t *sender)
PN_EXTERN pn_data_t * pn_connection_remote_properties(pn_connection_t *connection)
pn_snd_settle_mode_t
Definition: engine.h:73
PN_EXTERN pn_data_t * pn_terminus_capabilities(pn_terminus_t *terminus)
Definition: engine.h:86
struct pn_data_t pn_data_t
Definition: codec.h:97
PN_EXTERN void pn_delivery_dump(pn_delivery_t *delivery)
PN_EXTERN pn_expiry_policy_t pn_terminus_get_expiry_policy(pn_terminus_t *terminus)
PN_EXTERN pn_error_t * pn_transport_error(pn_transport_t *transport)
PN_EXTERN void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t *tracer)
PN_EXTERN bool pn_delivery_readable(pn_delivery_t *delivery)
PN_EXTERN uint32_t pn_disposition_get_section_number(pn_disposition_t *disposition)
PN_EXTERN const char * pn_connection_remote_hostname(pn_connection_t *connection)
PN_EXTERN pn_session_t * pn_link_session(pn_link_t *link)
PN_EXTERN pn_data_t * pn_connection_properties(pn_connection_t *connection)
PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *ssn, size_t capacity)
PN_EXTERN const char * pn_terminus_get_address(pn_terminus_t *terminus)
PN_EXTERN uint64_t pn_disposition_type(pn_disposition_t *disposition)
void( pn_tracer_t)(pn_transport_t *transport, const char *message)
Definition: engine.h:123
PN_EXTERN void pn_session_free(pn_session_t *session)
PN_EXTERN pn_terminus_t * pn_link_remote_target(pn_link_t *link)
PN_EXTERN int pn_link_remote_credit(pn_link_t *link)
pn_expiry_policy_t
Definition: engine.h:62
PN_EXTERN void * pn_session_get_context(pn_session_t *session)
PN_EXTERN pn_millis_t pn_transport_get_idle_timeout(pn_transport_t *transport)
PN_EXTERN uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport)
Definition: engine.h:52
PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *ssn)
Definition: engine.h:53
struct pn_disposition_t pn_disposition_t
Definition: engine.h:83
Definition: engine.h:76
PN_EXTERN bool pn_terminus_is_dynamic(pn_terminus_t *terminus)
PN_EXTERN void * pn_connection_get_context(pn_connection_t *connection)
Access the application context that is associated with the connection.
PN_EXTERN pn_distribution_mode_t pn_terminus_get_distribution_mode(const pn_terminus_t *terminus)
PN_EXTERN int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic)
struct pn_condition_t pn_condition_t
Definition: engine.h:49
PN_EXTERN pn_link_t * pn_link_head(pn_connection_t *connection, pn_state_t state)
Retrieve the first Link that matches the given state mask.
PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection)
Retrieve the state of the connection.
PN_EXTERN pn_disposition_t * pn_delivery_local(pn_delivery_t *delivery)
struct pn_transport_t pn_transport_t
Definition: engine.h:44
PN_EXTERN bool pn_disposition_is_failed(pn_disposition_t *disposition)
PN_EXTERN pn_data_t * pn_terminus_filter(pn_terminus_t *terminus)
PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt,...)
PN_EXTERN pn_transport_t * pn_transport(void)
Factory for creating a transport.
PN_EXTERN void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t)
PN_EXTERN const char * pn_condition_redirect_host(pn_condition_t *condition)
PN_EXTERN bool pn_transport_quiesced(pn_transport_t *transport)
PN_EXTERN void pn_session_open(pn_session_t *session)
PN_EXTERN const char * pn_condition_get_name(pn_condition_t *condition)
PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection)
Binds the transport to an AMQP connection endpoint.
implicitly settle rcvd xfers
Definition: engine.h:79
PN_EXTERN bool pn_delivery_settled(pn_delivery_t *delivery)
PN_EXTERN void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed)
PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size)
Process input data following the tail pointer.
PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available)
PN_EXTERN pn_error_t * pn_link_error(pn_link_t *link)
PN_EXTERN pn_condition_t * pn_disposition_condition(pn_disposition_t *disposition)
PN_EXTERN int pn_transport_close_head(pn_transport_t *transport)
Indicate that the output has closed.
int pn_state_t
encodes the state of an endpoint
Definition: engine.h:98
PN_EXTERN const char * pn_connection_remote_container(pn_connection_t *connection)
PN_EXTERN pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery)
PN_EXTERN pn_condition_t * pn_connection_condition(pn_connection_t *connection)
PN_EXTERN pn_durability_t pn_terminus_get_durability(pn_terminus_t *terminus)
PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit)
PN_EXTERN pn_session_t * pn_session(pn_connection_t *connection)
Factory for creating a new session on the connection.
pn_distribution_mode_t
Definition: engine.h:68
PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context)
PN_EXTERN bool pn_link_is_sender(pn_link_t *link)
PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context)
PN_EXTERN pn_data_t * pn_terminus_outcomes(pn_terminus_t *terminus)
PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit)
Definition: engine.h:58
PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *ssn)
PN_EXTERN pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now)
Process any pending transport timer events.
PN_EXTERN int pn_terminus_set_address(pn_terminus_t *terminus, const char *address)
PN_EXTERN pn_terminus_t * pn_link_remote_source(pn_link_t *link)
PN_EXTERN bool pn_link_get_drain(pn_link_t *link)
PN_EXTERN int pn_link_credit(pn_link_t *link)
PN_EXTERN pn_terminus_type_t pn_terminus_get_type(pn_terminus_t *terminus)
Definition: engine.h:55
PN_EXTERN int pn_terminus_set_timeout(pn_terminus_t *terminus, pn_seconds_t)
PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size)
Removes ::size bytes of output from the pending output queue following the transport&#39;s head pointer...
PN_EXTERN pn_delivery_t * pn_work_next(pn_delivery_t *delivery)
Get the next delivery on the connection that needs has pending operations.
#define PN_EXTERN
Definition: import_export.h:53
PN_EXTERN void pn_delivery_update(pn_delivery_t *delivery, uint64_t state)
PN_EXTERN pn_data_t * pn_disposition_data(pn_disposition_t *disposition)
PN_EXTERN void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset)
PN_EXTERN void * pn_delivery_get_context(pn_delivery_t *delivery)
size_t size
Definition: engine.h:87
PN_EXTERN int pn_link_queued(pn_link_t *link)
PN_EXTERN const char * pn_link_name(pn_link_t *link)
PN_EXTERN pn_delivery_t * pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
PN_EXTERN void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number)
Definition: engine.h:64
PN_EXTERN const char * pn_condition_get_description(pn_condition_t *condition)
PN_EXTERN pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport)
PN_EXTERN pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link)
Definition: engine.h:74
int64_t pn_timestamp_t
Definition: types.h:41
PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *ssn)
PN_EXTERN bool pn_link_draining(pn_link_t *receiver)
PN_EXTERN pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link)
PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n)
PN_EXTERN pn_condition_t * pn_link_remote_condition(pn_link_t *link)
PN_EXTERN pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link)
struct pn_session_t pn_session_t
Session.
Definition: engine.h:46
PN_EXTERN void pn_connection_free(pn_connection_t *connection)
PN_EXTERN bool pn_link_is_receiver(pn_link_t *link)
PN_EXTERN pn_data_t * pn_terminus_properties(pn_terminus_t *terminus)
struct pn_delivery_t pn_delivery_t
Definition: engine.h:84
PN_EXTERN int pn_terminus_copy(pn_terminus_t *terminus, pn_terminus_t *src)
PN_EXTERN pn_link_t * pn_sender(pn_session_t *session, const char *name)
PN_EXTERN void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable)
PN_EXTERN pn_data_t * pn_connection_desired_capabilities(pn_connection_t *connection)