Go to the documentation of this file.
27 if (
a->ss_family !=
b->ss_family)
29 if (
a->ss_family == AF_INET) {
30 return (((
const struct sockaddr_in *)
a)->sin_addr.s_addr !=
31 ((
const struct sockaddr_in *)
b)->sin_addr.s_addr);
34 #if HAVE_STRUCT_SOCKADDR_IN6
35 if (
a->ss_family == AF_INET6) {
36 const uint8_t *s6_addr_a = ((
const struct sockaddr_in6 *)
a)->sin6_addr.s6_addr;
37 const uint8_t *s6_addr_b = ((
const struct sockaddr_in6 *)
b)->sin6_addr.s6_addr;
38 return memcmp(s6_addr_a, s6_addr_b, 16);
47 if (
s->nb_exclude_addrs) {
48 for (
i = 0;
i <
s->nb_exclude_addrs;
i++) {
53 if (
s->nb_include_addrs) {
54 for (
i = 0;
i <
s->nb_include_addrs;
i++) {
64 const char *hostname,
int port,
67 struct addrinfo hints = { 0 }, *res = 0;
70 const char *node = 0, *service =
"0";
73 snprintf(sport,
sizeof(sport),
"%d", port);
76 if ((hostname) && (hostname[0] !=
'\0') && (hostname[0] !=
'?')) {
85 node ? node :
"unknown",
96 int *address_list_size_ptr)
102 while (buf && buf[0]) {
114 av_dynarray2_add((
void **)address_list_ptr, address_list_size_ptr,
sizeof(source_addr), (
uint8_t *)&source_addr);
115 if (!*address_list_ptr)
131 if (parse_include_list)
137 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...
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...
static const struct PPFilter filters[]
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.
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.
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,...)