亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dvbctrl.c

?? linux下的dvb收看解析軟件代碼; 帶參考程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*Copyright (C) 2006  Adam CharrettThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USAdvbctrl.cApplication to control dvbstreamer in daemon mode.*/#include "config.h"#include <stdlib.h>#include <stdio.h>#include <string.h>#include <ctype.h>#include <getopt.h>#include <unistd.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/types.h>#include <linux/dvb/frontend.h>#include "types.h"#include "logging.h"#include "binarycomms.h"#include "messages.h"#define MESSAGE_SENDRECV() \    do{\        if (MessageSend(&message, socketfd))\        {\            printlog(LOG_ERROR, "Sending message failed!\n");\            exit(1);\        }\        if (MessageRecv(&message, socketfd))\        {\            printlog(LOG_ERROR, "Failed to receive message!\n");\            exit(1);\        }\    }while(0)/* For use when only an RERR message is expected */#define CHECK_RERR_OK() \    do{\    if (MessageGetCode(&message) == MSGCODE_RERR) \    {\        uint8_t code = 0;\        char *text = NULL;\        MessageReadUint8(&message, &code);\        if (code != 0)\        {\            MessageReadString(&message, &text);\            printf("ERROR (%d) %s\n", code, text);\            free(text);\            return;\        }\    }\    else\    {\        printlog(LOG_ERROR, "Unexpected response message! (type 0x%02x)\n",\                 MessageGetCode(&message) );\        return;\    }\    }while(0)/* For use when a message other than RERR is expected */#define CHECK_EXPECTED(_expected) \    do{\    if (MessageGetCode(&message) == MSGCODE_RERR) \    {\        uint8_t code = 0;\        char *text = NULL;\        MessageReadUint8(&message, &code);\        MessageReadString(&message, &text);\        printf("ERROR (%d) %s\n", code, text);\        free(text);\        return;\    }\    else if (MessageGetCode(&message) != (_expected))\    {\        printlog(LOG_ERROR, "Unexpected response message! (type 0x%02x)",\                 MessageGetCode(&message) );\        return;\    }\    }while(0)#define AUTHENTICATE() \    do{\        if (!Authenticate())\        {\            printf("Failed to Authenticate username/password!\n");\        }\    }while(0)typedef struct ServiceOutput_t{    char *name;    char *destination;    char *service;}ServiceOutput_t;typedef struct ServiceOutputList_t{    int nrofOutputs;    ServiceOutput_t *outputs;}ServiceOutputList_t;typedef struct ManualOutput_t{    char *name;    char *destination;}ManualOutput_t;typedef struct ManualOutputList_t{    int nrofOutputs;    ManualOutput_t *outputs;}ManualOutputList_t;typedef struct InfoParam_t{    char *name;    uint8_t value;}InfoParam_t;typedef void (*CommandFunc_t)(char *argv[]);typedef struct Command_t{    char *name;    int nrofArgs;    char *help;    CommandFunc_t func;}Command_t;static void usage(char *appname);static void version(void);static bool Authenticate();static int ParsePID(char *argument);static ServiceOutputList_t* GetServiceOutputs();static void FreeServiceOutputs(ServiceOutputList_t *list);static ManualOutputList_t* GetManualOutputs();static void FreeManualOutputs(ManualOutputList_t *outputs);static void CommandInfo(char *argv[]);static void CommandServices(char *argv[]);static void CommandSelect(char *argv[]);static void CommandCurrent(char *argv[]);static void CommandPids(char *argv[]);static void CommandStats(char *argv[]);static void CommandAddOutput(char *argv[]);static void CommandRmOutput(char *argv[]);static void CommandOutputs(char *argv[]);static void CommandAddRmPID(char *argv[]);static void CommandListSFS(char *argv[]);static void CommandSetSF(char *argv[]);static void CommandFEStatus(char *argv[]);/* Used by logging to determine whether to include date/time info */int DaemonMode = FALSE;static Message_t message;static int socketfd = -1;static char *host = "localhost";static int adapterNumber = 0;static char *username = NULL;static char *password = NULL;static char pidsCmd[] = "pids";static char lspidsCmd[] ="lspids";static char servicesCmd[] = "services";static char multiplexCmd[]= "multiplex";static char addpidCmd[] = "addpid";static char rmpidCmd[]  = "rmpid";static char addoutputCmd[] = "addoutput";static char addsfCmd[] = "addsf";static char rmoutputCmd[] = "rmoutput";static char rmsfCmd[] = "rmsf";static Command_t commands[] =    {        {            "info", 1,            "Retrieves information about the host, use info <param> where param "            "is name for the name of the host, fetype for the front end type, "            "upsecs for the number of seconds the server has been running, uptime "            "for a nice time string on how long the host has been running.",            CommandInfo        },        {            servicesCmd, 0,            "List all available services.",            CommandServices        },        {            multiplexCmd, 0,            "List all the services on the current multiplex.",            CommandServices        },        {            "select", 1,            "Select the service to stream to the primary output.",            CommandSelect        },        {            "current", 0,            "Print out the service currently being streamed.",            CommandCurrent        },        {            pidsCmd, 1,            "List the PIDs for a specified service",            CommandPids        },        {            "stats", 0,            "Display the stats for the PAT,PMT and service PID filters",            CommandStats        },        {            addoutputCmd, 2,            "Takes <output name> <ipaddress>:<udp port>\n"            "Adds a new destination for sending packets to. This is only used for "            "manually filtered packets. "            "To send packets to this destination you'll need to also call \'filterpid\' "            "with this output as an argument.",            CommandAddOutput        },        {            rmoutputCmd, 1,            "Takes <output name>\n"            "Removes the destination and stops all filters associated with this output.",            CommandRmOutput        },        {            "lsoutputs", 0,            "List all active additonal output names and destinations.",            CommandOutputs        },        {            addpidCmd, 2,            "Takes <output name> <pid>\n"            "Adds a PID to the filter to be sent to the specified output.",            CommandAddRmPID        },        {            rmpidCmd, 2,            "Takes <output name> <pid>\n"            "Removes the PID from the filter that is sending packets to the specified output.",            CommandAddRmPID        },        {            lspidsCmd, 1,            "Takes <output name>\n"            "List the PIDs being filtered for a specific output",            CommandPids        },        {            addsfCmd, 2,            "Takes <output name> <ipaddress>:<udp port>\n"            "Adds a new destination for sending a secondary service to.",            CommandAddOutput        },        {            rmsfCmd, 1,            "Takes <output name>\n"            "Remove a destination for sending secondary services to.",            CommandRmOutput        },        {            "lssfs", 0,            "List all secondary service filters their names, destinations and currently selected service.",            CommandListSFS        },        {            "setsf", 2,            "Takes <output name> <service name>\n"            "Stream the specified service to the secondary service output.",            CommandSetSF        },        {            "festatus", 0,            "Displays whether the front end is locked, the bit error rate and signal to noise"            "ratio and the signal strength",            CommandFEStatus        },        {            NULL, 0, NULL, NULL        }    };static InfoParam_t infoParams[] =    {        { "name",   0x00 },        { "fetype", 0x01 },        { "upsecs", 0xfe },        { "uptime", 0xff },        { NULL,     0x00 },    };int main(int argc, char *argv[]){    int i, consumed;    struct hostent *hostinfo;    struct sockaddr_in sockaddr;    while (TRUE)    {        char c;        c = getopt(argc, argv, "vVh:a:u:p:");        if (c == -1)        {            break;        }        switch (c)        {            case 'v':                verbosity ++;                break;            case 'V':                version();                exit(0);                break;            case 'h':                host = optarg;                printlog(LOG_INFOV, "Will connect to host %s\n", host);                break;            case 'a':                adapterNumber = atoi(optarg);                printlog(LOG_INFOV, "Using adapter %d\n", adapterNumber);                break;            case 'u':                username = optarg;                break;            case 'p':                password = optarg;                break;            default:                usage(argv[0]);                exit(1);        }    }    /* Commands follow options */    if (optind >= argc)    {        printlog(LOG_ERROR, "No commands specified!\n");        exit(1);    }    /* Connect to host */    socketfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);    if (socketfd == -1)    {        printlog(LOG_ERROR, "Failed to create socket!\n");        exit(1);    }    sockaddr.sin_port = htons(BINARYCOMMS_PORT + adapterNumber);    hostinfo = gethostbyname(host);    if (hostinfo == NULL)    {        printlog(LOG_ERROR, "Failed to find address for \"%s\"\n", host);    }    sockaddr.sin_family = hostinfo->h_addrtype;    memcpy((char *)&(sockaddr.sin_addr), hostinfo->h_addr, hostinfo->h_length);    if (connect(socketfd, (const struct sockaddr *) &sockaddr, sizeof(sockaddr)))    {        printlog(LOG_ERROR, "Failed to connect to host %s:%d\n",                 inet_ntoa(sockaddr.sin_addr), BINARYCOMMS_PORT + adapterNumber);        exit(1);    }    printlog(LOG_DEBUG, "Socket connected to %s:%d\n",             inet_ntoa(sockaddr.sin_addr), BINARYCOMMS_PORT + adapterNumber);    /* Process commands */    consumed = 0;    for (i = optind; i < argc; i += consumed)    {        int c;        bool found = FALSE;        for (c = 0; commands[c].name; c ++)        {            if (strcasecmp(argv[i], commands[c].name) == 0)            {                consumed = 1 + commands[c].nrofArgs;                commands[c].func(&argv[i]);                found = TRUE;            }        }        if (!found)        {            printlog(LOG_ERROR, "Unknown command \"%s\"\n", argv[i]);            break;        }    }    /* Disconnect from host */    close(socketfd);    printlog(LOG_DEBUG, "Socket closed\n");    return 0;}/* * Output command line usage and help. */static void usage(char *appname){    int c;    fprintf(stderr, "Usage:%s [<options>] <commands>\n"            "      Options:\n"            "      -v            : Increase the amount of debug output, can be used multiple\n"            "                      times for more output\n"            "      -V            : Print version information then exit\n"            "      -h host       : Host to control\n"            "      -a <adapter>  : DVB Adapter number to control on the host\n",            appname           );    fprintf(stderr, "\nCommands include:\n");    for (c = 0; commands[c].name; c ++)    {        fprintf(stderr, "%10s:\n%s\n\n", commands[c].name, commands[c].help);    }}/* * Output version and license conditions */static void version(void){    printf("%s - %s\n"           "Written by Adam Charrett (charrea6@users.sourceforge.net).\n"           "\n"           "Copyright 2006 Adam Charrett\n"           "This is free software; see the source for copying conditions.  There is NO\n"           "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",           PACKAGE, VERSION);}/******************************************************************************//* Command functions                                                          *//******************************************************************************/static void CommandInfo(char *argv[]){    int i;    int found = -1;    for (i = 0; infoParams[i].name; i ++)    {        if (strcasecmp(infoParams[i].name, argv[1]) == 0)        {            found = i;            break;        }    }    if (found < 0)    {        printlog(LOG_ERROR, "Unknown info \"%s\"\n", argv[1]);        return ;    }    printlog(LOG_DEBUG, "Querying host for \"%s\"\n", infoParams[found].name);    MessageInit(&message, MSGCODE_INFO);    MessageEncode(&message, "b", infoParams[found].value);    MESSAGE_SENDRECV();    if (MessageGetCode(&message) == MSGCODE_RERR)    {        uint8_t code;        char *text = NULL;        MessageDecode(&message, "bs", &code, &text);        if (code == 0)        {            printf("%s\n", text);        }        else        {            printf("ERROR (%d) %s\n", code, text);        }    }    else    {        printlog(LOG_ERROR, "Unexpected response message! (type 0x%02x)",                 MessageGetCode(&message) );    }}static void CommandServices(char *argv[])

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本久久电影网| 久久伊人蜜桃av一区二区| 日韩欧美一区二区不卡| 国产蜜臀av在线一区二区三区 | 欧美中文字幕一区二区三区| 日韩三级免费观看| 亚洲精选免费视频| 国产成人啪免费观看软件| 91麻豆精品国产| 亚洲欧美视频在线观看视频| 九九九精品视频| 欧美精品日韩综合在线| 亚洲欧美区自拍先锋| 成+人+亚洲+综合天堂| 久久人人97超碰com| 美女一区二区视频| 欧美福利电影网| 亚洲午夜av在线| 在线观看视频91| 亚洲欧美一区二区三区孕妇| 成人午夜在线视频| 国产精品素人视频| 国产91清纯白嫩初高中在线观看| 欧美大白屁股肥臀xxxxxx| 日韩国产欧美一区二区三区| 色狠狠色噜噜噜综合网| 一区二区免费在线播放| 色呦呦一区二区三区| 国产精品进线69影院| 成人在线综合网站| 国产精品系列在线| 成人激情动漫在线观看| 国产精品免费网站在线观看| 成人三级伦理片| 国产精品麻豆久久久| 国产成都精品91一区二区三| 国产午夜精品一区二区三区视频 | 欧美疯狂性受xxxxx喷水图片| 夜夜亚洲天天久久| 欧美视频一区二| 日韩电影一区二区三区四区| 欧美日韩黄色一区二区| 亚洲成人精品影院| 日韩欧美一级精品久久| 经典三级在线一区| 中文字幕不卡三区| 91传媒视频在线播放| 亚洲成a人片在线观看中文| 欧美午夜一区二区| 另类调教123区 | 亚洲欧美一区二区三区久本道91| 色综合久久久久综合99| 午夜一区二区三区视频| 欧美福利一区二区| 国产精品小仙女| 亚洲丝袜精品丝袜在线| 欧美三级中文字| 日本麻豆一区二区三区视频| 欧美精品一区二区不卡| 成人h动漫精品一区二| 亚洲成人在线观看视频| 欧美mv和日韩mv的网站| av毛片久久久久**hd| 亚洲国产视频a| 久久―日本道色综合久久| 99久久精品国产一区| 亚洲成av人**亚洲成av**| 2023国产精品| 色香蕉成人二区免费| 久久精品国产网站| 亚洲日本中文字幕区| 欧美日韩成人激情| 国产夫妻精品视频| 亚洲最快最全在线视频| 久久久久久久久久久久久久久99 | 欧美日韩一区二区三区免费看| 日韩精品视频网站| 国产精品亲子伦对白| 欧美日韩在线播| 国产精品白丝jk黑袜喷水| 亚洲成a人片在线观看中文| 国产精品免费网站在线观看| 欧美男人的天堂一二区| bt欧美亚洲午夜电影天堂| 蜜桃在线一区二区三区| 国产精品美女久久久久久2018| 欧美精品第1页| 91欧美一区二区| 国产精品一卡二卡在线观看| 三级精品在线观看| 中文字幕在线观看一区| 久久久精品国产免大香伊| 91精品久久久久久久99蜜桃| 91亚洲国产成人精品一区二三| 国内精品自线一区二区三区视频| 亚洲综合一二三区| 亚洲欧美一区二区三区孕妇| 欧美激情中文字幕| 久久精品在这里| 久久影音资源网| 337p粉嫩大胆噜噜噜噜噜91av| 91精品国产麻豆国产自产在线| 色999日韩国产欧美一区二区| www.在线成人| 成人精品免费网站| 国产福利一区二区三区在线视频| 蜜桃91丨九色丨蝌蚪91桃色| 天天综合日日夜夜精品| 丝瓜av网站精品一区二区| 亚洲电影在线播放| 亚洲亚洲人成综合网络| 亚洲一区二区综合| 亚洲尤物视频在线| 亚洲综合成人在线| 一区二区三区四区精品在线视频 | av高清不卡在线| 成人免费看的视频| 国产精品系列在线观看| 激情小说欧美图片| 韩国女主播一区二区三区| 国产一区二区在线观看免费| 另类小说色综合网站| 国产在线日韩欧美| 成人毛片在线观看| 色偷偷88欧美精品久久久| 欧美色偷偷大香| 欧美精品视频www在线观看| 日韩一级二级三级精品视频| 欧美xxxxxxxxx| 久久综合色婷婷| 国产精品美女一区二区三区| 成人欧美一区二区三区黑人麻豆| 亚洲欧洲三级电影| 亚洲韩国一区二区三区| 日韩精品三区四区| 国产精品资源站在线| av电影在线观看不卡| 欧美日韩精品三区| 精品三级av在线| 1024成人网色www| 午夜成人免费电影| 国产成人免费视频精品含羞草妖精| 成人免费毛片片v| 欧美精品一级二级| 日本一区二区三区视频视频| 一区二区三区中文字幕精品精品| 视频在线在亚洲| 国产福利一区二区三区视频| 97久久超碰精品国产| 欧美三级视频在线| 久久精品欧美日韩精品| 亚洲免费观看高清| 国产综合久久久久久久久久久久| 成人sese在线| 日韩一级免费观看| 亚洲欧美福利一区二区| 蜜臂av日日欢夜夜爽一区| 成人性生交大片| 欧美日韩国产综合久久| 国产精品三级电影| 免费xxxx性欧美18vr| 99视频国产精品| 日韩美女视频一区二区在线观看| 亚洲理论在线观看| 国产乱子轮精品视频| 欧美日韩精品一区二区在线播放| 久久久久国产精品麻豆ai换脸| 亚洲精品成人天堂一二三| 狠狠久久亚洲欧美| 欧美伊人久久大香线蕉综合69 | 亚洲欧美综合网| 国产一区欧美二区| 欧美精品第1页| 一区二区三区91| 久久99热这里只有精品| 精品视频色一区| 中文字幕一区视频| 成人国产精品视频| 久久美女艺术照精彩视频福利播放 | 日韩欧美一区二区视频| 一区二区欧美精品| 91麻豆国产在线观看| 国产女人aaa级久久久级| 蜜桃在线一区二区三区| 这里是久久伊人| 亚洲福利一区二区三区| 色成人在线视频| 中文字幕一区二区三区在线播放 | 91久久精品一区二区三区| 国产性做久久久久久| 激情综合五月天| 日韩免费高清av| 精品中文字幕一区二区小辣椒| 欧美肥妇bbw| 亚洲成人精品影院| 欧美日韩免费不卡视频一区二区三区| 亚洲精品乱码久久久久久久久| 成人av小说网| 国产精品欧美极品| a级高清视频欧美日韩|