Changeset 40687
- Timestamp:
- 08/01/17 17:03:45 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/ca.h
r40686 r40687 941 941 return 0; 942 942 } 943 944 //host_lac funktion 945 int cahostlacAPDU(struct dvbdev* dvbnode, int sessionnr, unsigned char *tag, void *data, int len) 946 { 947 debug(620, "host lac manager cahostlacAPDU start"); 948 949 struct casession* casession = NULL; 943 950 951 if(dvbnode == NULL || dvbnode->caslot == NULL) return 0; 952 casession = dvbnode->caslot->casession; 953 954 debug(620, "host lac manager %02x %02x %02x", tag[0], tag[1], tag[2]); 955 956 uint8_t data_reply[4]; 957 958 /* check for German or French in titan settings, 959 if not found use English */ 960 if(ostrcmp(getconfig("lang", NULL), "po/de") == 0) 961 { 962 data_reply[0] = 0x64; /* d */ 963 data_reply[1] = 0x65; /* e */ 964 data_reply[2] = 0x75; /* u */ 965 } 966 else if(ostrcmp(getconfig("lang", NULL), "po/fr") == 0) 967 { 968 data_reply[0] = 0x66; /* f */ 969 data_reply[1] = 0x72; /* r */ 970 data_reply[2] = 0x61; /* a */ 971 } 972 else 973 { 974 data_reply[0] = 0x65; /* e */ 975 data_reply[1] = 0x6e; /* n */ 976 data_reply[2] = 0x67; /* g */ 977 } 978 979 if ((tag[0] == 0x9f) && (tag[1] == 0x81)) 980 { 981 switch (tag[2]) 982 { 983 case 0x00: /* country enquiry */ 984 { 985 debug(620, "country answered with '%s'", data_reply); 986 uint8_t tag[3] = { 0x9f, 0x81, 0x01 }; /* host country reply */ 987 sendAPDU(dvbnode, sessionnr, tag, data_reply, 3); 988 break; 989 } 990 case 0x10: /* language enquiry */ 991 { 992 debug(620, "language answered with '%s'", data_reply); 993 uint8_t tag[3] = { 0x9f, 0x81, 0x11 }; /* host language reply */ 994 sendAPDU(dvbnode, sessionnr, tag, data_reply, 3); 995 break; 996 } 997 default: 998 debug(620, "unknown host lac apdu tag %02x", tag[2]); 999 } 1000 } 1001 return 0; 1002 } 1003 int cahostlacaction(struct dvbdev* dvbnode, int sessionnr) 1004 { 1005 struct casession* casession = NULL; 1006 if(dvbnode == NULL || dvbnode->caslot == NULL) return 0; 1007 casession = dvbnode->caslot->casession; 1008 1009 debug(620, "cahostlacaction nr %d, stat %d", sessionnr, casession[sessionnr].state); 1010 1011 switch (casession[sessionnr].state) 1012 { 1013 case CASESSIONSTART: 1014 { 1015 debug(620, "state casessionstart"); 1016 unsigned char tag[] = {0x9f, 0x80, 0x20}; 1017 sendAPDU(dvbnode, sessionnr, tag, NULL, 0); 1018 casession[sessionnr].state = CASESSIONFINAL; 1019 break; 1020 } 1021 default: 1022 err("unknown state"); 1023 } 1024 return 0; 1025 } 1026 944 1027 #endif 945 1028 … … 1123 1206 {0x00, 0x03, 0x00, 0x41}, // conditional access 1124 1207 {0x00, 0x20, 0x00, 0x41}, // host control 1125 {0x00, 0x20, 0x00, 0x42}, // host control2 1208 {0x00, 0x20, 0x00, 0x42}, // host control2 1209 {0x00, 0x24, 0x00, 0x41}, // date-time 1126 1210 {0x00, 0x40, 0x00, 0x41}, // mmi 1127 1211 {0x00, 0x41, 0x00, 0x41}, // mmi app1 1128 1212 {0x00, 0x41, 0x00, 0x42}, // mmi app2 1129 {0x00, 0x24, 0x00, 0x41}, // date-time1130 {0x00, 0x8c, 0x10, 0x01}, // content control1131 1132 1213 {0x00, 0x8c, 0x10, 0x01}, // content control 1133 1214 #ifdef BAD 1134 1215 {0x00, 0x8c, 0x10, 0x02}, // content control 1135 1216 #endif 1217 {0x00, 0x8d, 0x10, 0x01} // host lac 1136 1218 {0x00, 0x8e, 0x10, 0x01} // upgrade 1137 1219 }; … … 1448 1530 else if(casession[sessionnr].upgrademanager == 1) 1449 1531 casession[sessionnr].action = caupgradeaction(dvbnode, sessionnr); 1532 else if(casession[sessionnr].hostlacmanager == 1) 1533 casession[sessionnr].action = cahostlacaction(dvbnode, sessionnr); 1450 1534 #endif 1451 1535 return 1; … … 1553 1637 debug(620, "create session upgrade manager"); 1554 1638 break; 1639 case 0x008d1001: 1640 casession[sessionnr].inuse = 1; 1641 casession[sessionnr].hostlacmanager = 1; 1642 debug(620, "create session host lac manager"); 1643 break; 1555 1644 #endif 1556 1645 default: … … 1732 1821 { 1733 1822 if(caupgradeAPDU(dvbnode, sessionnr, tag, pkt, alen)) 1823 casession->action = 1; 1824 } 1825 else if(casession->hostlacmanager == 1) 1826 { 1827 if(cahostlacAPDU(dvbnode, sessionnr, tag, pkt, alen)) 1734 1828 casession->action = 1; 1735 1829 }
Note: See TracChangeset
for help on using the changeset viewer.