#include "htsp.h"
#include "streaming.h"
#include "transports.h"
-
+#include "psi.h"
#include "htsmsg_binary.h"
#include <sys/statvfs.h>
LIST_FOREACH(t, &ch->ch_transports, tht_ch_link) {
htsmsg_t *svcmsg = htsmsg_create_map();
+ uint16_t caid;
htsmsg_add_str(svcmsg, "name", transport_nicename(t));
htsmsg_add_str(svcmsg, "type", transport_servicetype_txt(t));
htsmsg_add_msg(services, NULL, svcmsg);
+ if((caid = transport_get_encryption(t)) != 0) {
+ htsmsg_add_u32(svcmsg, "caid", caid);
+ htsmsg_add_str(svcmsg, "caname", psi_caid2name(caid));
+ }
}
htsmsg_add_msg(out, "services", services);
}
+/**
+ * Get the encryption CAID from a transport
+ * only the first CA stream in a transport is returned
+ */
+uint16_t
+transport_get_encryption(th_transport_t *t)
+{
+ th_stream_t *st;
+ caid_t *c;
+
+ TAILQ_FOREACH(st, &t->tht_components, st_link) {
+ switch(st->st_type) {
+ case SCT_CA:
+ LIST_FOREACH(c, &st->st_caids, link)
+ if(c->caid != 0)
+ return c->caid;
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
/**
* Get the signal status from a transport
int tss2errcode(int tss);
+uint16_t transport_get_encryption(th_transport_t *t);
+
int transport_get_signal_status(th_transport_t *t, signal_status_t *status);
#endif /* TRANSPORTS_H */