minidlna: update to 1.1.5
[tomato.git] / release / src / router / minidlna / clients.h
blob190d5690f6508b902ee56f655560e12680693d51
1 /* MiniDLNA media server
2 * Copyright (C) 2013 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 /* Response-related flags */
41 #define FLAG_HAS_CAPTIONS 0x80000000
42 #define RESPONSE_FLAGS 0xF0000000
44 enum match_types {
45 EMatchNone,
46 EUserAgent,
47 EXAVClientInfo,
48 EFriendlyName,
49 EModelName,
50 EFriendlyNameSSDP
53 enum client_types {
54 EXbox = 1,
55 EPS3,
56 EDenonReceiver,
57 EDirecTV,
58 EFreeBox,
59 ELGDevice,
60 ELifeTab,
61 EMarantzDMP,
62 EMediaRoom,
63 ENetgearEVA2000,
64 EPanasonic,
65 EPopcornHour,
66 ERokuSoundBridge,
67 ESamsungSeriesA,
68 ESamsungSeriesB,
69 ESamsungSeriesCDEBDP,
70 ESamsungSeriesCDE,
71 ESonyBDP,
72 ESonyBravia,
73 ESonyInternetTV,
74 EToshibaTV,
75 EAsusOPlay,
76 EBubbleUPnP,
77 ENetFrontLivingConnect,
78 EStandardDLNA150,
79 EStandardUPnP
82 struct client_type_s {
83 enum client_types type;
84 uint32_t flags;
85 const char *name;
86 const char *match;
87 enum match_types match_type;
90 struct client_cache_s {
91 struct in_addr addr;
92 unsigned char mac[6];
93 struct client_type_s *type;
94 time_t age;
95 int connections;
98 extern struct client_type_s client_types[];
99 extern struct client_cache_s clients[CLIENT_CACHE_SLOTS];
101 struct client_cache_s *SearchClientCache(struct in_addr addr, int quiet);
102 struct client_cache_s *AddClientCache(struct in_addr addr, int type);
104 #endif