libklvanc
 All Classes Files Functions Variables Enumerations Macros
cache.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Kernel Labs Inc. All Rights Reserved
3  *
4  * Address: Kernel Labs Inc., PO Box 745, St James, NY. 11780
5  * Contact: sales@kernellabs.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
29 #ifndef _VANC_CACHE_H
30 #define _VANC_CACHE_H
31 
32 #include <pthread.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
39 {
40  int active;
41  uint64_t count;
42  pthread_mutex_t mutex;
43  struct klvanc_packet_header_s *pkt;
44 };
45 
47 {
48  uint32_t did, sdid;
49  const char *desc, *spec;
50  struct timeval lastUpdated;
51  int hasCursor;
52  int expandUI;
53  uint32_t activeCount;
54  struct klvanc_cache_line_s lines[2048];
55 };
56 
65 
73 void klvanc_cache_reset(struct klvanc_context_s *ctx);
74 
82 struct klvanc_cache_s * klvanc_cache_lookup(struct klvanc_context_s *ctx, uint8_t didnr, uint8_t sdidnr);
83 
84 #ifdef __cplusplus
85 };
86 #endif
87 
88 #endif /* _VANC_CACHE_H */
TODO - Brief description goes here.
Definition: vanc-packets.h:57
int klvanc_context_enable_cache(struct klvanc_context_s *ctx)
Begin caching and summarizing VANC payload, useful when you want to query what VANC messages...
Application specific context, the library allocates and stores user specific instance information...
Definition: vanc.h:118
struct klvanc_cache_s * klvanc_cache_lookup(struct klvanc_context_s *ctx, uint8_t didnr, uint8_t sdidnr)
When caching and summarizing VANC payload is enabled, lookup any statistics related to didnr and sdid...
Definition: cache.h:46
void klvanc_cache_reset(struct klvanc_context_s *ctx)
When caching and summarizing VANC payload is enabled, use this to reset any internal counters...
Definition: cache.h:38