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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? voudpconfig.cpp

?? voudp - VoIP for NetBSD
?? CPP
字號:
//// Copyright 2004 Alan Post//// This file is part of voudp.//// voudp is free software; you can redistribute it and/or modify it under the// terms of the GNU General Public License as published by the Free Software// Foundation; either version 2 of the License, or (at your option) any later// version.//// voudp is distributed in the hope that it will be useful, but WITHOUT ANY// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR// A PARTICULAR PURPOSE.  See the GNU General Public License for more details.//// You should have received a copy of the GNU General Public License along with// voudp; if not, write to the Free Software Foundation, Inc., 59 Temple Place,// Suite 330, Boston, MA  02111-1307  USA//#include "voudpconfig_msg.h"#include "sender.h"#include "die.h"#include <string.h>#include <sys/socket.h>#include <sys/un.h>#include <unistd.h>#include <err.h>#include <stdio.h>staticvoid usage( int status ){    FILE *out = ( status == EXIT_SUCCESS ) ? stdout : stderr;    fprintf( out,"Usage:  voudpconfig -h           Print this message to stdout\n""        voudpconfig -a           Show all recipients\n""        voudpconfig diagnostics  Print diagnostic info to the log\n""        voudpconfig <name>       Show info on the recipient <name>\n""        voudpconfig <name> {start|stop}\n""                                 Start or stop sending to <name>\n""        voudpconfig <name> delete\n""                                 Delete recipient <name> from the db\n""        voudpconfig <name> [max_packet_len l] [max_buf_ms n] [host h] [port p]\n""                                 Set info on <name>\n"    );    exit( status );}staticvoid boom() { exit( EXIT_FAILURE ); }staticint voudpd_socket(){    int sock = socket( PF_LOCAL, SOCK_STREAM, 0 );    if ( sock == -1 ) die( "socket" );    sockaddr_un addr;    addr.sun_len = sizeof( addr );    addr.sun_family = PF_LOCAL;    strlcpy( addr.sun_path, sock_path, sizeof( addr.sun_path ));    if ( -1 == connect( sock, (struct sockaddr*) &addr, sizeof( addr )))        die( "connect" );    return sock;}staticvoid my_close( int fd ){    if ( -1 == close( fd )) die( "close fd" );}staticvoid print_record( const std::string      &name,                   const recipient_info_t &info,                   const bool             &sending ){    printf( "%s:\n"            "  host/port:  %s:%d\n"            "  maximum packet bytes:  %lu\n"            "  maximum packet ms:  %lu\n"            "  sending:  %s\n",            name.c_str(), info.host.c_str(), info.port,            (unsigned long) info.max_packet_len,            (unsigned long) info.max_buf_ms,            sending ? "yes" : "no" );}staticbool get_info( const std::string      &name,                     recipient_info_t &info,                     bool             &sending ){    int fd = voudpd_socket();    if ( ! send_req_code( fd, voudpconfig_msg::GET_INFO )) boom();    if ( ! send_name( fd, name )) boom();    voudpconfig_msg::resp_code_t resp;    if ( ! decode_resp_code( fd, resp )) boom();        if ( resp != voudpconfig_msg::FOUND )    {        my_close( fd );        return false;    }    if ( ! decode_info( fd, info )) boom();    if ( ! decode_bool( fd, sending )) boom();    my_close( fd );    return true;}staticvoid set_info( const std::string      &name,               const recipient_info_t &info ){    int fd = voudpd_socket();    if ( ! send_req_code( fd, voudpconfig_msg::SET_INFO )) boom();    if ( ! send_name( fd, name )) boom();    if ( ! send_info( fd, info )) boom();    voudpconfig_msg::resp_code_t resp;    if ( ! decode_resp_code( fd, resp )) boom();    if ( resp != voudpconfig_msg::OK )        errx( EXIT_FAILURE, "Couldn't set information" );    my_close( fd );}int main( int argc, char **argv ){    if ( argc == 2 && 0 == strcmp( argv[1], "-h" ))        usage( EXIT_SUCCESS );    if ( argc == 2 && 0 == strcmp( argv[1], "-a" ))    {        int fd = voudpd_socket();        if ( ! send_req_code( fd, voudpconfig_msg::SHOW_ALL )) boom();        voudpconfig_msg::resp_code_t resp;        if ( ! decode_resp_code( fd, resp )) boom();        if ( resp != voudpconfig_msg::OK )            errx( EXIT_FAILURE, "Couldn't fetch records" );        std::string name;        recipient_info_t info;        bool sending;        while (    decode_name( fd, name )                && decode_info( fd, info )                && decode_bool( fd, sending ))            print_record( name, info, sending );        my_close( fd );        exit( EXIT_SUCCESS );    }    if ( argc == 2 && 0 == strcmp( argv[1], "diagnostics" ))    {        int fd = voudpd_socket();        if ( ! send_req_code( fd, voudpconfig_msg::PRINT_DIAGNOSTICS ))            boom();        voudpconfig_msg::resp_code_t resp;        if ( ! decode_resp_code( fd, resp )) boom();        if ( resp != voudpconfig_msg::OK )            errx( EXIT_FAILURE, "Couldn't print diagnostic info" );        my_close( fd );        exit( EXIT_SUCCESS );    }    if ( argc == 2 )    {        recipient_info_t info;        bool sending;        if ( ! get_info( argv[1], info, sending ))            errx( EXIT_FAILURE, "No such user %s", argv[1]);        print_record( argv[1], info, sending );        exit( EXIT_SUCCESS );    }    if ( argc == 3 )    {        voudpconfig_msg::req_code_t code;        if      ( ! strcmp( argv[ 2 ], "start" )) code = voudpconfig_msg::START;        else if ( ! strcmp( argv[ 2 ], "stop" )) code = voudpconfig_msg::STOP;        else if ( ! strcmp( argv[ 2 ], "delete" )) code = voudpconfig_msg::DELETE;        else usage( EXIT_FAILURE );        std::string name = argv[ 1 ];        int fd = voudpd_socket();        if ( ! send_req_code( fd, code )) boom();        if ( ! send_name( fd, name )) boom();        voudpconfig_msg::resp_code_t resp;        if ( ! decode_resp_code( fd, resp )) boom();        if ( resp != voudpconfig_msg::OK )            errx( EXIT_FAILURE, "No such user %s", name.c_str());        my_close( fd );        exit( EXIT_SUCCESS );    }    if ( argc > 2 && ( argc % 2 == 0 ))    {        //        // I want ocaml option types here.  Sigh.        // Of course, there *is* a boost.org C++ version of ocaml options....        //        bool has_mpl = false;        bool has_mbm = false;        bool has_host = false;        bool has_port = false;        size_t max_packet_len;        size_t max_buf_ms;        std::string host;        int port;        std::string name = argv[ 1 ];        for ( int i = 2; i < argc; i += 2 )        {            if ( ! strcmp( "max_packet_len", argv[ i ]))            {                has_mpl = true;                max_packet_len = (size_t) atol( argv[ i + 1 ]);                continue;            }            if ( ! strcmp( "max_buf_ms", argv[ i ]))            {                has_mbm = true;                max_buf_ms = (size_t) atol( argv[ i + 1 ]);                continue;            }            if ( ! strcmp( "host", argv[ i ]))            {                has_host = true;                host = argv[ i + 1 ];                continue;            }            if ( ! strcmp( "port", argv[ i ]))            {                has_port = true;                port = atoi( argv[ i + 1 ]);                continue;            }        }        recipient_info_t info;        bool dummy;        if ( ! get_info( name, info, dummy ))        {            if ( ! ( has_host && has_port && has_mpl && has_mbm ))            {                errx( EXIT_FAILURE,                      "New recipient must have all fields specified" );            }        }        if ( has_host ) info.host = host;        if ( has_port ) info.port = port;        if ( has_mpl ) info.max_packet_len = max_packet_len;        if ( has_mbm ) info.max_buf_ms = max_buf_ms;        set_info( name, info );        exit( EXIT_SUCCESS );    }    usage( EXIT_FAILURE );    assert( NULL == "not reachable" );    return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91成人在线精品| 久久久精品影视| 精品国产一区二区三区久久影院 | 色婷婷亚洲精品| 8x8x8国产精品| 国产精品视频第一区| 日韩av中文在线观看| www.日韩在线| 欧美r级在线观看| 午夜日韩在线电影| 91亚洲资源网| 国产日产欧产精品推荐色| 亚洲成人在线免费| 99re热视频精品| 久久精品人人做人人爽人人| 亚洲成人免费视| 99re在线精品| 国产精品久久久久四虎| 国产又黄又大久久| 日韩一级片在线观看| 亚洲国产成人精品视频| 色婷婷久久综合| 中文字幕一区二区不卡| 国产+成+人+亚洲欧洲自线| 欧美va亚洲va国产综合| 蜜臀久久99精品久久久画质超高清| 欧洲精品在线观看| 樱桃国产成人精品视频| 99久久国产综合色|国产精品| 久久精品亚洲国产奇米99| 精品亚洲成a人| 精品国产91洋老外米糕| 免费欧美在线视频| 日韩久久免费av| 精品一区二区综合| 久久一日本道色综合| 国产一区高清在线| 久久精品一区二区三区不卡| 国产乱码精品一区二区三区忘忧草 | 在线观看av一区二区| 综合欧美一区二区三区| 色综合一区二区| 亚洲综合激情另类小说区| 在线观看三级视频欧美| 亚洲午夜三级在线| 欧美美女激情18p| 奇米影视一区二区三区小说| 欧美一区二区免费观在线| 成人午夜又粗又硬又大| 国产欧美视频一区二区三区| 成人免费毛片a| 亚洲精品久久7777| 4438成人网| 精品一区在线看| 国产精品视频一二| 在线亚洲高清视频| 青草av.久久免费一区| 久久久综合视频| 99视频国产精品| 天堂成人免费av电影一区| 精品88久久久久88久久久| 国产99久久精品| 亚洲一卡二卡三卡四卡| 日韩一区二区麻豆国产| 成人免费高清在线观看| 一区二区在线观看不卡| 日韩美女视频在线| av在线不卡观看免费观看| 亚洲va天堂va国产va久| 久久久噜噜噜久久中文字幕色伊伊| www.综合网.com| 免费成人深夜小野草| 中文字幕在线播放不卡一区| 欧美日韩极品在线观看一区| 国产一本一道久久香蕉| 亚洲一区二区欧美| 国产亚洲精品超碰| 欧美日韩高清影院| 国产91精品在线观看| 日韩福利电影在线| 亚洲欧美偷拍卡通变态| 欧美本精品男人aⅴ天堂| 色老头久久综合| 国产传媒欧美日韩成人| 天天av天天翘天天综合网| 亚洲国产精品国自产拍av| 欧美顶级少妇做爰| 99久久99久久精品国产片果冻| 蜜桃av一区二区三区| 国产精品久久精品日日| 精品盗摄一区二区三区| 欧美日韩三级在线| 一本色道亚洲精品aⅴ| 国产一区二区伦理| 日本不卡视频在线| 一区二区在线观看不卡| 国产精品久久久久久久久图文区| 日韩欧美123| 88在线观看91蜜桃国自产| 91在线免费看| 成人av资源在线| 国产精品一卡二卡| 久久电影网站中文字幕| 亚洲丶国产丶欧美一区二区三区| 国产精品家庭影院| 亚洲国产精品黑人久久久| 久久久久久一二三区| 日韩欧美视频在线| 日韩一区二区在线观看视频 | 国产欧美一区二区精品性色| 日韩欧美一级精品久久| 欧美男人的天堂一二区| 色素色在线综合| 在线视频一区二区三| 在线精品亚洲一区二区不卡| 91色porny在线视频| 91在线观看美女| 91热门视频在线观看| 91免费国产在线观看| 色噜噜狠狠色综合欧洲selulu| 91在线观看下载| 色先锋aa成人| 色综合天天综合给合国产| 91丨porny丨户外露出| 日韩欧美三级在线| 91精品在线免费观看| 日韩欧美久久久| 久久综合999| 国产精品麻豆视频| 亚洲欧美另类小说| 午夜免费久久看| 免费在线看成人av| 国产一区二区三区美女| 国产传媒久久文化传媒| av不卡在线观看| 欧美亚洲国产一区在线观看网站| 欧美日韩五月天| 日韩视频一区二区三区在线播放| 欧美videossexotv100| 国产欧美精品国产国产专区| 亚洲欧洲另类国产综合| 亚洲二区在线观看| 久久黄色级2电影| 成人精品小蝌蚪| 在线观看亚洲精品视频| 日韩亚洲欧美高清| 中文字幕高清一区| 亚洲成人久久影院| 国内精品伊人久久久久av影院 | 国产欧美精品国产国产专区| 亚洲欧美日韩国产综合| 丝袜美腿亚洲一区二区图片| 国产美女av一区二区三区| 91在线一区二区三区| 欧美一区二区私人影院日本| 国产午夜亚洲精品羞羞网站| 一区二区三区日本| 国产尤物一区二区| 欧美性感一区二区三区| 国产亚洲人成网站| 亚洲成av人影院| 粉嫩一区二区三区性色av| 欧美剧情电影在线观看完整版免费励志电影| 欧美mv日韩mv| 亚洲大片精品永久免费| 国产高清在线精品| 91精品免费观看| 亚洲男同性恋视频| 国产在线一区观看| 欧美高清视频不卡网| 国产精品伦一区二区三级视频| 五月激情六月综合| 色综合一区二区| 国产夜色精品一区二区av| 日韩中文字幕不卡| 色偷偷久久人人79超碰人人澡| 2023国产精华国产精品| 天天影视涩香欲综合网| 日本精品视频一区二区三区| 国产农村妇女精品| 精品一区二区精品| 欧美一级日韩不卡播放免费| 亚洲综合免费观看高清在线观看| 国产91精品精华液一区二区三区 | 亚洲国产日韩a在线播放 | 精品午夜久久福利影院| 精品视频在线看| 亚洲欧美日韩久久| 成人福利在线看| 国产欧美一区在线| 精品一区二区三区在线视频| 69p69国产精品| 亚洲大尺度视频在线观看| 欧亚一区二区三区| 亚洲午夜在线观看视频在线| 一本大道av一区二区在线播放| 中文字幕一区在线| 9i在线看片成人免费| 亚洲色图欧美偷拍| 在线欧美小视频|