• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/ntp/sntp/libevent/include/event2/

Lines Matching refs:bufferevent

31    @file event2/bufferevent.h
38 A bufferevent provides input and output buffers that get filled and
39 drained automatically. The user of a bufferevent no longer deals
43 Once initialized, the bufferevent structure can be used repeatedly
46 When reading is enabled, the bufferevent will try to read from the
48 When writing is enabled, the bufferevent will try to write data onto its
56 <dd>A bufferevent that reads and writes data onto a network
65 <dd>A bufferevent that transforms data, and sends or receives it
66 over another underlying bufferevent. Created with
70 <dd>A bufferevent that uses the openssl library to send and
96 These flags are passed as arguments to a bufferevent's event callback.
111 @see event2/bufferevent.h
113 struct bufferevent
123 A read or write callback for a bufferevent.
132 @param bev the bufferevent that triggered the callback
133 @param ctx the user-specified context for this bufferevent
135 typedef void (*bufferevent_data_cb)(struct bufferevent *bev, void *ctx);
138 An event/error callback for a bufferevent.
144 that have happened on the bufferevent since the last callback invocation.
146 @param bev the bufferevent for which the error condition was reached
152 @param ctx the user-specified context for this bufferevent
154 typedef void (*bufferevent_event_cb)(struct bufferevent *bev, short what, void *ctx);
156 /** Options that can be specified when creating a bufferevent */
159 * descriptor/bufferevent/whatever when this bufferevent is freed. */
162 /** If set, and threading is enabled, operations on this bufferevent
170 * bufferevent. This option currently requires that
177 Create a new socket bufferevent over an existing socket.
179 @param base the event base to associate with the new bufferevent.
185 @return a pointer to a newly allocated bufferevent struct, or NULL if an
190 struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, int options);
193 Launch a connect() attempt with a socket-based bufferevent.
198 If the bufferevent does not already have a socket set, we allocate a new
202 and configure the bufferevent so that a BEV_EVENT_CONNECTED event will be
205 @param bufev an existing bufferevent allocated with
212 int bufferevent_socket_connect(struct bufferevent *, struct sockaddr *, int);
219 @param bufev An existing bufferevent allocated with bufferevent_socket_new()
242 int bufferevent_socket_connect_hostname(struct bufferevent *,
249 @param bev The bufferevent object.
254 int bufferevent_socket_get_dns_error(struct bufferevent *bev);
257 Assign a bufferevent to a specific event_base.
262 @param bufev a bufferevent struct returned by bufferevent_new()
268 int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev);
271 Return the event_base used by a bufferevent
274 struct event_base *bufferevent_get_base(struct bufferevent *bev);
277 Assign a priority to a bufferevent.
281 @param bufev a bufferevent struct
286 int bufferevent_priority_set(struct bufferevent *bufev, int pri);
289 Return the priority of a bufferevent.
294 int bufferevent_get_priority(const struct bufferevent *bufev);
297 Deallocate the storage associated with a bufferevent structure.
299 If there is pending data to write on the bufferevent, it probably won't be
300 flushed before the bufferevent is freed.
302 @param bufev the bufferevent structure to be freed.
305 void bufferevent_free(struct bufferevent *bufev);
309 Changes the callbacks for a bufferevent.
311 @param bufev the bufferevent object for which to change callbacks
323 void bufferevent_setcb(struct bufferevent *bufev,
328 Retrieves the callbacks for a bufferevent.
330 @param bufev the bufferevent to examine.
332 read callback for the bufferevent.
334 current write callback for the bufferevent.
336 current event callback for the bufferevent.
338 callback argument for the bufferevent.
342 void bufferevent_getcb(struct bufferevent *bufev,
349 Changes the file descriptor on which the bufferevent operates.
350 Not supported for all bufferevent types.
352 @param bufev the bufferevent object for which to change the file descriptor
356 int bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd);
359 Returns the file descriptor associated with a bufferevent, or -1 if
360 no file descriptor is associated with the bufferevent.
363 evutil_socket_t bufferevent_getfd(struct bufferevent *bufev);
366 Returns the underlying bufferevent associated with a bufferevent (if
367 the bufferevent is a wrapper), or NULL if there is no underlying bufferevent.
370 struct bufferevent *bufferevent_get_underlying(struct bufferevent *bufev);
373 Write data to a bufferevent buffer.
379 @param bufev the bufferevent to be written to
386 int bufferevent_write(struct bufferevent *bufev,
391 Write data from an evbuffer to a bufferevent buffer. The evbuffer is
394 @param bufev the bufferevent to be written to
400 int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
404 Read data from a bufferevent buffer.
408 @param bufev the bufferevent to be read from
414 size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
417 Read data from a bufferevent buffer into an evbuffer. This avoids
420 @param bufev the bufferevent to be read from
425 int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
432 @param bufev the bufferevent from which to get the evbuffer
437 struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
447 @param bufev the bufferevent from which to get the evbuffer
452 struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
455 Enable a bufferevent.
457 @param bufev the bufferevent to be enabled
463 int bufferevent_enable(struct bufferevent *bufev, short event);
466 Disable a bufferevent.
468 @param bufev the bufferevent to be disabled
474 int bufferevent_disable(struct bufferevent *bufev, short event);
477 Return the events that are enabled on a given bufferevent.
479 @param bufev the bufferevent to inspect
483 short bufferevent_get_enabled(struct bufferevent *bufev);
486 Set the read and write timeout for a bufferevent.
488 A bufferevent's timeout will fire the first time that the indicated
490 during which the bufferevent was trying to read or write.
493 bufferevent's read or write operation has been suspended because
498 Calling bufferevent_enable or setting a timeout for a bufferevent
503 bufferevent's event callback is called with the
507 @param bufev the bufferevent to be modified
512 int bufferevent_set_timeouts(struct bufferevent *bufev,
518 On input, a bufferevent does not invoke the user read callback unless
520 is beyond the high watermark, the bufferevent stops reading from the network.
527 @param bufev the bufferevent to be modified
534 void bufferevent_setwatermark(struct bufferevent *bufev, short events,
542 @param bufev the bufferevent to be examined
548 int bufferevent_getwatermark(struct bufferevent *bufev, short events,
552 Acquire the lock on a bufferevent. Has no effect if locking was not
556 void bufferevent_lock(struct bufferevent *bufev);
559 Release the lock on a bufferevent. Has no effect if locking was not
563 void bufferevent_unlock(struct bufferevent *bufev);
581 Triggers the bufferevent to produce more data if possible.
583 @param bufev the bufferevent object
589 int bufferevent_flush(struct bufferevent *bufev,
609 Triggers bufferevent data callbacks.
615 @param bufev the bufferevent object
620 void bufferevent_trigger(struct bufferevent *bufev, short iotype,
624 Triggers the bufferevent event callback.
628 @param bufev the bufferevent object
633 void bufferevent_trigger_event(struct bufferevent *bufev, short what,
656 /** A callback function to implement a filter for a bufferevent.
679 Allocate a new filtering bufferevent on top of an existing bufferevent.
681 @param underlying the underlying bufferevent.
683 bufferevent
685 bufferevent
686 @param options A bitfield of bufferevent options.
688 this bufferevent is freed.
692 struct bufferevent *
693 bufferevent_filter_new(struct bufferevent *underlying,
707 @param options A set of options for this bufferevent
708 @param pair A pointer to an array to hold the two new bufferevent objects.
713 struct bufferevent *pair[2]);
716 Given one bufferevent returned by bufferevent_pair_new(), returns the
720 struct bufferevent *bufferevent_pair_get_partner(struct bufferevent *bev);
723 Abstract type used to configure rate-limiting on a bufferevent or a group
762 until no bufferevent is using it.
768 Set the rate-limit of a the bufferevent 'bev' to the one specified in
769 'cfg'. If 'cfg' is NULL, disable any per-bufferevent rate-limiting on
772 Note that only some bufferevent types currently respect rate-limiting.
779 int bufferevent_set_rate_limit(struct bufferevent *bev,
795 Note also that only some bufferevent types currently respect rate-limiting.
815 bufferevent in a group for reading or writing at a time.
819 only willing to send 1 byte per tick per bufferevent, you might instead
822 up send 1 byte per tick per bufferevent on average, but you don't send
844 A bufferevent may belong to no more than one rate-limit group at a time.
851 int bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
856 int bufferevent_remove_from_rate_limit_group(struct bufferevent *bev);
866 int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
876 int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
880 ev_ssize_t bufferevent_get_max_single_read(struct bufferevent *bev);
884 ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
889 Return the current read or write bucket size for a bufferevent.
890 If it is not configured with a per-bufferevent ratelimit, return
892 Note that it can return a negative value if the bufferevent has been
898 ev_ssize_t bufferevent_get_read_limit(struct bufferevent *bev);
900 ev_ssize_t bufferevent_get_write_limit(struct bufferevent *bev);
904 ev_ssize_t bufferevent_get_max_to_read(struct bufferevent *bev);
906 ev_ssize_t bufferevent_get_max_to_write(struct bufferevent *bev);
909 const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct bufferevent * bev);
914 Return the read or write bucket size for a bufferevent rate limit
931 Subtract a number of bytes from a bufferevent's read or write bucket.
934 bufferevent will resume or suspend reading writing as appropriate.
935 These functions make no change in the buckets for the bufferevent's
943 int bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr);
945 int bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr);
951 Subtract a number of bytes from a bufferevent rate-limiting group's