Wrap up version 1.3.3.
[minidlna.git] / clients.h
bloba5925665a922adfd5dfca0e5724528ad40ff1997
1 /* MiniDLNA media server
2 * Copyright (C) 2013-2017 NETGEAR
4 * This file is part of MiniDLNA.
6 * MiniDLNA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * MiniDLNA is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __CLIENTS_H__
19 #define __CLIENTS_H__
20 #include <stdint.h>
21 #include <sys/time.h>
22 #include <netinet/in.h>
24 #define CLIENT_CACHE_SLOTS 25
26 /* Client capability/quirk flags */
27 #define FLAG_DLNA 0x00000001
28 #define FLAG_MIME_AVI_DIVX 0x00000002
29 #define FLAG_MIME_AVI_AVI 0x00000004
30 #define FLAG_MIME_FLAC_FLAC 0x00000008
31 #define FLAG_MIME_WAV_WAV 0x00000010
32 #define FLAG_RESIZE_THUMBS 0x00000020
33 #define FLAG_NO_RESIZE 0x00000040
34 #define FLAG_MS_PFS 0x00000080 /* Microsoft PlaysForSure client */
35 #define FLAG_SAMSUNG 0x00000100
36 #define FLAG_SAMSUNG_DCM10 0x00000200
37 #define FLAG_AUDIO_ONLY 0x00000400
38 #define FLAG_FORCE_SORT 0x00000800
39 #define FLAG_CAPTION_RES 0x00001000
40 #define FLAG_SKIP_DLNA_PN 0x00002000 /* during browsing */
41 #define FLAG_CONVERT_MS 0x00004000 /* convert ms to s */
42 /* Response-related flags */
43 #define FLAG_HAS_CAPTIONS 0x10000000
44 #define RESPONSE_TRUNCATED 0x80000000
45 #define RESPONSE_FLAGS 0xF0000000
47 enum match_types {
48 EMatchNone,
49 EUserAgent,
50 EXAVClientInfo,
51 EFriendlyName,
52 EModelName,
53 EFriendlyNameSSDP
56 enum client_types {
57 EXbox = 1,
58 EPS3,
59 ECling,
60 EDenonReceiver,
61 EDirecTV,
62 EFreeBox,
63 ELGDevice,
64 ELGNetCastDevice,
65 ELifeTab,
66 EMarantzDMP,
67 EMediaRoom,
68 ENetgearEVA2000,
69 EPanasonic,
70 EPopcornHour,
71 ERokuSoundBridge,
72 ESamsungSeriesA,
73 ESamsungSeriesB,
74 ESamsungSeriesCDEBDP,
75 ESamsungSeriesQ,
76 ESamsungSeriesCDE,
77 ESamsungBDJ5500,
78 ESonyBDP,
79 ESonyBravia,
80 ESonyInternetTV,
81 EToshibaTV,
82 EHyundaiTV,
83 EAsusOPlay,
84 EBubbleUPnP,
85 ENetFrontLivingConnect,
86 EKodi,
87 EMovian,
88 EStandardDLNA150,
89 EStandardUPnP
92 struct client_type_s {
93 enum client_types type;
94 uint32_t flags;
95 const char *name;
96 const char *match;
97 enum match_types match_type;
100 struct client_cache_s {
101 struct in_addr addr;
102 unsigned char mac[6];
103 struct client_type_s *type;
104 time_t age;
105 int connections;
108 extern struct client_type_s client_types[];
109 extern struct client_cache_s clients[CLIENT_CACHE_SLOTS];
111 struct client_cache_s *SearchClientCache(struct in_addr addr, int quiet);
112 struct client_cache_s *AddClientCache(struct in_addr addr, int type);
114 #endif