network setup stuff
[enigma2.git] / lib / dvb_si / long_table.cpp
1 /*
2  * $Id: long_table.cpp,v 1.1 2003-10-17 15:36:37 tmbinc Exp $
3  *
4  * (C) 2002-2003 Andreas Oberritter <obi@saftware.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #include <lib/dvb_si/long_table.h>
23
24 LongTable::LongTable(const uint8_t * const buffer) : ShortTable(buffer)
25 {
26         tableIdExtension = (buffer[3] << 8) | buffer[4];
27         reserved3 = (buffer[5] >> 6) & 0x03;
28         versionNumber = (buffer[5] >> 1) & 0x1F;
29         currentNextIndicator = buffer[5] & 0x01;
30         sectionNumber = buffer[6];
31         lastSectionNumber = buffer[7];
32 }
33
34 uint16_t LongTable::getTableIdExtension(void) const
35 {
36         return tableIdExtension;
37 }
38
39 uint8_t LongTable::getVersionNumber(void) const
40 {
41         return versionNumber;
42 }
43
44 uint8_t LongTable::getCurrentNextIndicator(void) const
45 {
46         return currentNextIndicator;
47 }
48
49 uint8_t LongTable::getSectionNumber(void) const
50 {
51         return sectionNumber;
52 }
53
54 uint8_t LongTable::getLastSectionNumber(void) const
55 {
56         return lastSectionNumber;
57 }
58
59 bool LongTable::operator< (const LongTable &t) const
60 {
61         return (sectionNumber < t.sectionNumber);
62 }
63
64 bool LongTable::operator> (const LongTable &t) const
65 {
66         return (sectionNumber > t.sectionNumber);
67 }
68
69 bool LongTable::operator<= (const LongTable &t) const
70 {
71         return (sectionNumber <= t.sectionNumber);
72 }
73
74 bool LongTable::operator>= (const LongTable &t) const
75 {
76         return (sectionNumber >= t.sectionNumber);
77 }
78
79 bool LongTable::operator== (const LongTable &t) const
80 {
81         return (sectionNumber == t.sectionNumber);
82 }
83
84 bool LongTable::operator!= (const LongTable &t) const
85 {
86         return (sectionNumber != t.sectionNumber);
87 }
88