trunk 20080912
[gitenigma.git] / include / lib / dvb / lowlevel / sdt.h
blob305e278290bd3b51d70033f35d9b1c007926cb56
2 /*
3 * SERVICE DESCRIPTION TABLE
5 * Copyright (C) 1998 Thomas Mirlacher
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * The author may be reached as dent@cosy.sbg.ac.at, or
22 * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
23 * Austria
25 *------------------------------------------------------------
29 #ifndef __SDT_H__
30 #define __SDT_H__
32 #include <sys/types.h>
34 #define SDT_LEN 11
36 typedef struct {
37 u_char table_id : 8;
39 #if BYTE_ORDER == BIG_ENDIAN
40 u_char section_syntax_indicator : 1;
41 u_char : 3;
42 u_char section_length_hi : 4;
43 #else
44 u_char section_length_hi : 4;
45 u_char : 3;
46 u_char section_syntax_indicator : 1;
47 #endif
49 u_char section_length_lo : 8;
51 u_char transport_stream_id_hi : 8;
52 u_char transport_stream_id_lo : 8;
54 #if BYTE_ORDER == BIG_ENDIAN
55 u_char : 2;
56 u_char version_number : 5;
57 u_char current_next_indicator : 1;
58 #else
59 u_char current_next_indicator : 1;
60 u_char version_number : 5;
61 u_char : 2;
62 #endif
64 u_char section_number : 8;
65 u_char last_section_number : 8;
66 u_char original_network_id_hi : 8;
67 u_char original_network_id_lo : 8;
68 u_char : 8;
69 } sdt_t;
71 #define SDT_DESCR_LEN 5
73 struct sdt_descr_struct {
74 u_char service_id_hi : 8;
75 u_char service_id_lo : 8;
77 #if BYTE_ORDER == BIG_ENDIAN
78 u_char : 6;
79 u_char EIT_schedule_flag : 1;
80 u_char EIT_present_following_flag : 1;
82 u_char running_status : 3;
83 u_char free_ca_mode : 1;
84 u_char descriptors_loop_length_hi : 4;
85 #else
86 u_char EIT_present_following_flag : 1;
87 u_char EIT_schedule_flag : 1;
88 u_char : 6;
90 u_char descriptors_loop_length_hi : 4;
91 u_char free_ca_mode : 1;
92 u_char running_status : 3;
93 #endif
95 u_char descriptors_loop_length_lo : 8;
97 typedef struct sdt_descr_struct sdt_descr_t;
99 #define SDT_SERVICE_DESCRIPTOR 0x48
101 struct sdt_generic_descriptor {
102 u_char descriptor_tag : 8;
103 u_char descriptor_length : 8;
106 struct sdt_service_descriptor_1 {
107 u_char service_type : 8;
108 u_char service_provider_name_length : 8;
111 struct sdt_service_descriptor_2 {
112 u_char service_name_length : 8;
115 struct sdt_service_desc {
116 u_char description_tag : 8;
117 u_char description_length : 8;
118 u_char service_type : 8;
119 u_char service_provider_name_length : 8;
122 #endif