Go to the documentation of this file.
29 if (
a->ss_family !=
b->ss_family)
31 if (
a->ss_family == AF_INET) {
32 return (((
const struct sockaddr_in *)
a)->sin_addr.s_addr !=
33 ((
const struct sockaddr_in *)
b)->sin_addr.s_addr);
36 #if HAVE_STRUCT_SOCKADDR_IN6
37 if (
a->ss_family == AF_INET6) {
38 const uint8_t *s6_addr_a = ((
const struct sockaddr_in6 *)
a)->sin6_addr.s6_addr;
39 const uint8_t *s6_addr_b = ((
const struct sockaddr_in6 *)
b)->sin6_addr.s6_addr;
40 return memcmp(s6_addr_a, s6_addr_b, 16);
49 if (
s->nb_exclude_addrs) {
50 for (
i = 0;
i <
s->nb_exclude_addrs;
i++) {
55 if (
s->nb_include_addrs) {
56 for (
i = 0;
i <
s->nb_include_addrs;
i++) {
66 const char *hostname,
int port,
69 struct addrinfo hints = { 0 }, *res = 0;
72 const char *node = 0, *service =
"0";
75 snprintf(sport,
sizeof(sport),
"%d", port);
78 if ((hostname) && (hostname[0] !=
'\0') && (hostname[0] !=
'?')) {
87 node ? node :
"unknown",
98 int *address_list_size_ptr)
104 while (buf && buf[0]) {
116 av_dynarray2_add((
void **)address_list_ptr, address_list_size_ptr,
sizeof(source_addr), (uint8_t *)&source_addr);
117 if (!*address_list_ptr)
133 if (parse_include_list)
139 av_log(log_ctx,
AV_LOG_ERROR,
"Simultaneously including and excluding sources is not supported.\n");
static void error(const char *err)
static int ip_parse_addr_list(void *log_ctx, const char *buf, struct sockaddr_storage **address_list_ptr, int *address_list_size_ptr)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_ip_parse_sources(void *log_ctx, const char *buf, IPSourceFilters *filters)
Parses the address[,address] source list in buf and adds it to the filters in the IPSourceFilters str...
void * av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data)
Add an element of size elem_size to a dynamic array.
void ff_ip_reset_filters(IPSourceFilters *filters)
Resets the IP filter list and frees the internal fields of an IPSourceFilters structure.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static int ip_parse_sources_and_blocks(void *log_ctx, const char *buf, IPSourceFilters *filters, int parse_include_list)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define filters(fmt, type, inverse, clp, inverset, clip, one, clip_fn, packed)
static int compare_addr(const struct sockaddr_storage *a, const struct sockaddr_storage *b)
int ff_ip_parse_blocks(void *log_ctx, const char *buf, IPSourceFilters *filters)
Parses the address[,address] source block list in buf and adds it to the filters in the IPSourceFilte...
struct sockaddr * ai_addr
struct addrinfo * ff_ip_resolve_host(void *log_ctx, const char *hostname, int port, int type, int family, int flags)
Resolves hostname into an addrinfo structure.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
#define i(width, name, range_min, range_max)
Structure for storing IP (UDP) source filters or block lists.
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
int ff_ip_check_source_lists(struct sockaddr_storage *source_addr_ptr, IPSourceFilters *s)
Checks the source address against a given IP source filter.
#define flags(name, subs,...)