CAPMT_OSCAM_MULTILIST,
CAPMT_OSCAM_TCP,
CAPMT_OSCAM_UNIX_SOCKET,
- CAPMT_OSCAM_NET_PROTO
+ CAPMT_OSCAM_NET_PROTO,
+ CAPMT_OSCAM_UNIX_SOCKET_NP /* NET_PROTO through socket */
} capmt_oscam_mode_t;
/**
oscam != CAPMT_OSCAM_OLD;
}
+static inline int
+capmt_oscam_netproto(capmt_t *capmt)
+{
+ int oscam = capmt->capmt_oscam;
+ return oscam == CAPMT_OSCAM_NET_PROTO ||
+ oscam == CAPMT_OSCAM_UNIX_SOCKET_NP;
+}
+
static void
capmt_poll_add(capmt_t *capmt, int fd, uint32_t u32)
{
tvhlog(LOG_DEBUG, "capmt", "%s: Created socket %d", capmt_name(capmt), fd);
capmt->capmt_sock[i] = fd;
capmt->capmt_sock_reconnect[i]++;
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO)
+ if (capmt_oscam_netproto(capmt))
capmt_send_client_info(capmt);
capmt_poll_add(capmt, fd, i + 1);
}
capmt_dmx_t *filter;
capmt_filters_t *cf;
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO)
+ if (capmt_oscam_netproto(capmt))
pid = sbuf_peek_s16 (sb, offset + 6);
else
pid = sbuf_peek_s16be(sb, offset + 6);
capmt_notify_server(capmt_t *capmt, capmt_service_t *ct, int force)
{
/* flush out the greeting */
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO)
+ if (capmt_oscam_netproto(capmt))
capmt_flush_queue(capmt, 0);
pthread_mutex_lock(&capmt->capmt_mutex);
if (sb->sb_ptr - offset < 4)
return 0;
cmd = sbuf_peek_u32(sb, offset);
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO) {
+ if (capmt_oscam_netproto(capmt)) {
adapter_byte = 1; //we need to take into account the adapter index byte which is now after the cmd
} else {
if (!sb->sb_bswap && !sb->sb_err) {
return 4 + 32;
else if (oscam_new && cmd == DMX_SET_FILTER)
//when using network protocol the dmx_sct_filter_params fields are added seperately to avoid padding problems, so we substract 2 bytes:
- return 4 + 2 + 60 + adapter_byte + (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO ? -2 : 0);
+ return 4 + 2 + 60 + adapter_byte + (capmt_oscam_netproto(capmt) ? -2 : 0);
else if (oscam_new && cmd == DMX_STOP)
return 4 + 4 + adapter_byte;
else if (oscam_new && cmd == DVBAPI_SERVER_INFO)
cmd = sbuf_peek_u32(sb, offset);
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO && cmd != DVBAPI_SERVER_INFO) {
+ if (capmt_oscam_netproto(capmt) && cmd != DVBAPI_SERVER_INFO) {
adapter = sbuf_peek_u8(sb, 4);
offset = 1;
}
capmt->capmt_oscam,
capmt->capmt_sockfile, capmt->capmt_port,
what);
- } else if (capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET) {
+ } else if (capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET ||
+ capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET_NP) {
tvhlog(LOG_INFO, "capmt",
"%s: mode %i sockfile %s got connection from client (%s)",
capmt_name(capmt),
adapter = -1;
offset = 0;
while (buffer.sb_ptr > 0) {
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO) {
+ if (capmt_oscam_netproto(capmt)) {
buffer.sb_bswap = 1;
} else {
adapter = buffer.sb_data[0];
#else
if (capmt->capmt_oscam == CAPMT_OSCAM_TCP ||
capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO ||
- capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET) {
+ capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET ||
+ capmt->capmt_oscam == CAPMT_OSCAM_UNIX_SOCKET_NP) {
handle_single(capmt);
} else {
tvhlog(LOG_ERR, "capmt", "%s: Only modes 3 and 4 are supported for non-linuxdvb devices", capmt_name(capmt));
tvhlog(LOG_DEBUG, "capmt", "%s: %s: no subscribed services, closing socket, fd=%d", capmt_name(capmt), __FUNCTION__, capmt->capmt_sock[0]);
if (capmt->capmt_sock[0] >= 0)
caclient_set_status((caclient_t *)capmt, CACLIENT_STATUS_READY);
- if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO) {
+ if (capmt_oscam_netproto(capmt)) {
capmt_send_stop_descrambling(capmt);
capmt_pid_flush(capmt);
}
if (tuner < 0 && capmt->capmt_oscam != CAPMT_OSCAM_TCP &&
capmt->capmt_oscam != CAPMT_OSCAM_NET_PROTO &&
- capmt->capmt_oscam != CAPMT_OSCAM_UNIX_SOCKET) {
+ capmt->capmt_oscam != CAPMT_OSCAM_UNIX_SOCKET &&
+ capmt->capmt_oscam != CAPMT_OSCAM_UNIX_SOCKET_NP) {
tvhlog(LOG_WARNING, "capmt",
- "%s: Virtual adapters are supported only in modes 3 and 4 (service \"%s\")",
+ "%s: Virtual adapters are supported only in modes 3, 4, 5 and 6 (service \"%s\")",
capmt_name(capmt), t->s_dvb_svcname);
goto fin;
}
}
td = (th_descrambler_t *)ct;
- if (capmt->capmt_oscam == CAPMT_OSCAM_TCP || capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO) {
+ if (capmt->capmt_oscam == CAPMT_OSCAM_TCP ||
+ capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO) {
snprintf(buf, sizeof(buf), "capmt-%s-%i",
capmt->capmt_sockfile,
capmt->capmt_port);
tvhlog(LOG_INFO, "capmt", "%s: mode %i %s %s port %i destroyed",
capmt_name(capmt),
capmt->capmt_oscam,
- capmt->capmt_oscam == CAPMT_OSCAM_TCP || capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO ? "IP address" : "sockfile",
+ capmt->capmt_oscam == CAPMT_OSCAM_TCP ||
+ capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO ? "IP address" : "sockfile",
capmt->capmt_sockfile, capmt->capmt_port);
capmt_flush_queue(capmt, 1);
free(capmt->capmt_sockfile);
caclient_capmt_class_oscam_mode_list ( void *o, const char *lang )
{
static const struct strtab tab[] = {
+ { N_("OSCam new pc-nodmx (rev >= 10389)"), CAPMT_OSCAM_UNIX_SOCKET_NP },
{ N_("OSCam net protocol (rev >= 10389)"), CAPMT_OSCAM_NET_PROTO },
{ N_("OSCam pc-nodmx (rev >= 9756)"), CAPMT_OSCAM_UNIX_SOCKET },
{ N_("OSCam TCP (rev >= 9574)"), CAPMT_OSCAM_TCP },