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

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

?? smsc_fake.c

?? 主要包括sms網關和wap網關實現說明和源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ====================================================================  * The Kannel Software License, Version 1.0  *  * Copyright (c) 2001-2005 Kannel Group   * Copyright (c) 1998-2001 WapIT Ltd.    * All rights reserved.  *  * Redistribution and use in source and binary forms, with or without  * modification, are permitted provided that the following conditions  * are met:  *  * 1. Redistributions of source code must retain the above copyright  *    notice, this list of conditions and the following disclaimer.  *  * 2. Redistributions in binary form must reproduce the above copyright  *    notice, this list of conditions and the following disclaimer in  *    the documentation and/or other materials provided with the  *    distribution.  *  * 3. The end-user documentation included with the redistribution,  *    if any, must include the following acknowledgment:  *       "This product includes software developed by the  *        Kannel Group (http://www.kannel.org/)."  *    Alternately, this acknowledgment may appear in the software itself,  *    if and wherever such third-party acknowledgments normally appear.  *  * 4. The names "Kannel" and "Kannel Group" must not be used to  *    endorse or promote products derived from this software without  *    prior written permission. For written permission, please   *    contact org@kannel.org.  *  * 5. Products derived from this software may not be called "Kannel",  *    nor may "Kannel" appear in their name, without prior written  *    permission of the Kannel Group.  *  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE  * DISCLAIMED.  IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,   * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT   * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE   * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,   * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  * ====================================================================  *  * This software consists of voluntary contributions made by many  * individuals on behalf of the Kannel Group.  For more information on   * the Kannel Group, please see <http://www.kannel.org/>.  *  * Portions of this software are based upon software originally written at   * WapIT Ltd., Helsinki, Finland for the Kannel project.   */ /* * smsc_fake.c - interface to fakesmsc.c * * Uoti Urpala 2001 *//* Doesn't support multi-send * Doesn't warn about unrecognized configuration variables */#include <sys/types.h>#include <sys/socket.h>#include <unistd.h>#include <errno.h>#include <time.h>#include <limits.h>#include "gwlib/gwlib.h"#include "smscconn.h"#include "smscconn_p.h"#include "bb_smscconn_cb.h"#include "msg.h"#include "sms.h"#include "dlr.h"typedef struct privdata {    List	*outgoing_queue;    long	connection_thread;    int		shutdown; /* Signal to the connection thread to shut down */    int		listening_socket; /* File descriptor */    int		port;		  /* Port number to listen */    Octstr	*allow_ip, *deny_ip;} PrivData;static int fake_open_connection(SMSCConn *conn, PrivData *privdata){    int s;    if ((s = make_server_socket(privdata->port, (conn->our_host ? octstr_get_cstr(conn->our_host) : NULL))) == -1) {        error(0, "smsc_fake: could not create listening socket in port %d",	          privdata->port);        return -1;    }    if (socket_set_blocking(s, 0) == -1) {        error(0, "smsc_fake: couldn't make listening socket port %d non-blocking",	          privdata->port);        return -1;    }    privdata->listening_socket = s;    return 0;}static int sms_to_client(Connection *client, Msg *msg){    Octstr *line;    Octstr *msgdata = NULL; /* NULL to allow octstr_destroy */    char *contents;    int len;    debug("bb.sms", 0, "smsc_fake: sending message to client");//    msg_dump(msg, 0);    line = octstr_duplicate(msg->sms.sender);    octstr_append_char(line, ' ');    octstr_append(line, msg->sms.receiver);    if (octstr_len(msg->sms.udhdata)) {        octstr_append(line, octstr_imm(" udh "));        msgdata = octstr_duplicate(msg->sms.udhdata);        octstr_url_encode(msgdata);        octstr_append(line, msgdata);        octstr_destroy(msgdata);        octstr_append_char(line, ' ');        msgdata = octstr_duplicate(msg->sms.msgdata);        octstr_url_encode(msgdata);        octstr_append(line, msgdata);    } else {        contents = octstr_get_cstr(msg->sms.msgdata);        len = octstr_len(msg->sms.msgdata);        while (len > 0) {            len--;            if (contents[len] < 32 || contents[len] > 126) {                octstr_append(line, octstr_imm(" data "));                msgdata = octstr_duplicate(msg->sms.msgdata);                octstr_url_encode(msgdata);                octstr_append(line, msgdata);                goto notelse; /* C lacks "else" clause for while loops */            }        }        octstr_append(line, octstr_imm(" text "));        octstr_append(line, msg->sms.msgdata);    }notelse:    octstr_append_char(line, 10);    if (conn_write(client, line) == -1) {        octstr_destroy(msgdata);        octstr_destroy(line);        return -1;    }    octstr_destroy(msgdata);    octstr_destroy(line);    return 1;}static void msg_to_bb(SMSCConn *conn, Octstr *line){    long p, p2;    Msg *msg;    Octstr *type = NULL; /* might be destroyed after error before created */    msg = msg_create(sms);    p = octstr_search_char(line, ' ', 0);    if (p == -1)        goto error;    msg->sms.sender = octstr_copy(line, 0, p);    p2 = octstr_search_char(line, ' ', p + 1);    if (p2 == -1)        goto error;    msg->sms.receiver = octstr_copy(line, p + 1, p2 - p - 1);    p = octstr_search_char(line, ' ', p2 + 1);    if (p == -1)        goto error;    type = octstr_copy(line, p2 + 1, p - p2 - 1);    if (!octstr_compare(type, octstr_imm("text")))        msg->sms.msgdata = octstr_copy(line, p + 1, LONG_MAX);    else if (!octstr_compare(type, octstr_imm("data"))) {        msg->sms.msgdata = octstr_copy(line, p + 1, LONG_MAX);        if (octstr_url_decode(msg->sms.msgdata) == -1)            warning(0, "smsc_fake: urlcoded data from client looks malformed");    }    else if (!octstr_compare(type, octstr_imm("route"))) {        p2 = octstr_search_char(line, ' ', p + 1);        if (p2 == -1)            goto error;        msg->sms.boxc_id = octstr_copy(line, p + 1, p2 - p - 1);        msg->sms.msgdata = octstr_copy(line, p2 + 1, LONG_MAX);    }    else if (!octstr_compare(type, octstr_imm("udh"))) {        p2 = octstr_search_char(line, ' ', p + 1);        if (p2 == -1)            goto error;        msg->sms.udhdata = octstr_copy(line, p + 1, p2 - p - 1);        msg->sms.msgdata = octstr_copy(line, p2 + 1, LONG_MAX);        if (msg->sms.coding == DC_UNDEF)            msg->sms.coding = DC_8BIT;;        if (octstr_url_decode(msg->sms.msgdata) == -1 ||            octstr_url_decode(msg->sms.udhdata) == -1)            warning(0, "smsc_fake: urlcoded data from client looks malformed");    }    else if (!octstr_compare(type, octstr_imm("dlr-mask"))) {        Octstr *tmp;        p2 = octstr_search_char(line, ' ', p + 1);        if (p2 == -1)            goto error;        tmp = octstr_copy(line, p + 1, p2 - p - 1);        msg->sms.dlr_mask = atoi(octstr_get_cstr(tmp));        octstr_destroy(tmp);        msg->sms.msgdata = octstr_copy(line, p2 + 1, LONG_MAX);    }    else        goto error;    octstr_destroy(line);    octstr_destroy(type);    time(&msg->sms.time);    msg->sms.smsc_id = octstr_duplicate(conn->id);    debug("bb.sms", 0, "smsc_fake: new message received");//    msg_dump(msg, 0);    bb_smscconn_receive(conn, msg);    return;error:    warning(0, "smsc_fake: invalid message syntax from client, ignored");    msg_destroy(msg);    octstr_destroy(line);    octstr_destroy(type);    return;}static void main_connection_loop(SMSCConn *conn, Connection *client){    PrivData *privdata = conn->data;    Octstr *line;    Msg	*msg;    double delay = 0;    if (conn->throughput > 0) {        delay = 1.0 / conn->throughput;    }    while (1) {        while (!conn->is_stopped && !privdata->shutdown &&                (line = conn_read_line(client)))            msg_to_bb(conn, line);        if (conn_error(client))            goto error;        if (conn_eof(client))            goto eof;        while ((msg = gwlist_extract_first(privdata->outgoing_queue)) != NULL) {            if (sms_to_client(client, msg) == 1) {                /*                  * Now look for the DLR entry and pass it to the upper layer.                 * There is no *real* DLR awaited from the fakesmsc.                 */                if (DLR_IS_ENABLED_DEVICE(msg->sms.dlr_mask)) {                    Msg *dlrmsg;                    Octstr *tmp;                    int dlrstat = DLR_SUCCESS;                    char id[UUID_STR_LEN + 1];                    uuid_unparse(msg->sms.id, id);                    tmp = octstr_create(id);                    dlrmsg = dlr_find(conn->id,                                      tmp, /* smsc message id */                                      msg->sms.receiver, /* destination */                                      dlrstat);                    if (dlrmsg != NULL) {                        bb_smscconn_receive(conn, dlrmsg);                    } else {                        error(0,"smsc_fale: got DLR but could not find message or was not interested in it");                    }                    octstr_destroy(tmp);                }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美美女视频在线观看| 成人免费视频一区二区| 奇米综合一区二区三区精品视频| 国产视频一区二区在线观看| 在线观看一区二区视频| 国产一区二区三区免费在线观看| 亚洲国产aⅴ天堂久久| 日本一区二区三区久久久久久久久不 | 欧美激情一区二区三区四区| 日本韩国精品在线| 韩国精品主播一区二区在线观看| 国产丝袜在线精品| 欧美日韩日日夜夜| 欧美在线免费观看视频| 久久精品二区亚洲w码| 婷婷成人综合网| 亚洲一区二区在线免费观看视频| 久久青草欧美一区二区三区| 91精品久久久久久久91蜜桃| 91免费视频大全| 懂色av一区二区三区免费观看 | 五月激情丁香一区二区三区| 综合久久久久久| 亚洲国产成人av好男人在线观看| 制服丝袜亚洲网站| 欧美日本国产视频| 欧美老女人第四色| 欧美一级在线视频| 日韩欧美国产不卡| 亚洲精品一区二区三区福利| 2023国产一二三区日本精品2022| 精品蜜桃在线看| 久久精品网站免费观看| 国产精品色呦呦| 亚洲久草在线视频| 性欧美大战久久久久久久久| 日韩不卡一区二区| 免费在线观看成人| 美美哒免费高清在线观看视频一区二区 | 91蜜桃网址入口| 91国产视频在线观看| 欧美日本视频在线| 国产三级欧美三级日产三级99 | 一区二区三区精品视频在线| 午夜欧美在线一二页| 久久国产精品99精品国产| 国产91高潮流白浆在线麻豆 | 91免费版在线看| 色妹子一区二区| 欧美卡1卡2卡| 国产精品久久久久aaaa| 婷婷国产在线综合| 97久久精品人人澡人人爽| 在线成人免费视频| 91片在线免费观看| 日韩精品在线一区二区| 亚洲精品欧美在线| 国产精品小仙女| 欧美一区二区三区白人| 一区在线观看免费| 国产精品自拍一区| 51精品视频一区二区三区| 1区2区3区精品视频| 蜜桃精品视频在线观看| 欧美喷潮久久久xxxxx| 中文字幕在线不卡视频| 韩日av一区二区| 日韩一级高清毛片| 亚洲午夜激情av| 91在线观看美女| 久久久久久毛片| 人人爽香蕉精品| 欧美精品久久天天躁| 亚洲男同性恋视频| 日本国产一区二区| 亚洲国产日韩一区二区| 欧美三级日韩在线| 午夜精品一区二区三区免费视频 | 久久精品国产精品亚洲综合| 欧美日韩精品一区二区天天拍小说 | 在线亚洲一区二区| 综合精品久久久| 欧洲生活片亚洲生活在线观看| 亚洲美女免费视频| 成人免费高清在线| 亚洲人精品一区| 色激情天天射综合网| 一区二区三区波多野结衣在线观看 | 久久久精品免费观看| 国内精品免费**视频| 国产日韩成人精品| 国产成人精品一区二| 亚洲视频网在线直播| 欧美日韩你懂得| 午夜久久电影网| 国产精品区一区二区三| 欧美色图第一页| 国产一区二区女| 亚洲已满18点击进入久久| 日韩一级成人av| 国产精品自拍在线| 亚洲日本欧美天堂| 日韩精品最新网址| 色综合天天天天做夜夜夜夜做| 成人免费视频一区| 亚洲精品高清在线| 日韩女优毛片在线| eeuss国产一区二区三区| 亚洲v日本v欧美v久久精品| 精品久久久久久亚洲综合网| 色av成人天堂桃色av| 日日欢夜夜爽一区| 亚洲欧美日韩一区二区| 国产香蕉久久精品综合网| 欧美日韩国产色站一区二区三区| 国产98色在线|日韩| 人禽交欧美网站| 亚洲成人av一区二区| 亚洲视频一区在线| 亚洲三级在线免费观看| 国产精品嫩草久久久久| 久久久噜噜噜久久中文字幕色伊伊 | 精品国产自在久精品国产| 日韩午夜小视频| 欧美mv日韩mv亚洲| 欧美一区二区美女| 日韩色视频在线观看| 日韩欧美的一区| 久久久欧美精品sm网站| 久久久综合网站| 中文字幕第一区综合| 国产欧美一区二区三区在线老狼| 久久久久久久久岛国免费| 国产日韩三级在线| 国产精品进线69影院| 亚洲柠檬福利资源导航| 亚洲国产美国国产综合一区二区| 午夜国产精品一区| 国产一区二区调教| 91日韩一区二区三区| 欧美一卡二卡在线| 亚洲综合网站在线观看| 麻豆国产精品视频| 亚洲中国最大av网站| 成+人+亚洲+综合天堂| 国产亚洲欧洲997久久综合| 男人操女人的视频在线观看欧美| 欧美亚洲综合网| 亚洲乱码国产乱码精品精小说| 国产一区二区精品在线观看| 欧美电影免费观看高清完整版在线| 一区二区三区在线观看视频| 99九九99九九九视频精品| 欧美韩国一区二区| 国产福利91精品| 中文一区二区在线观看| 国产mv日韩mv欧美| 国产精品不卡视频| 91亚洲精华国产精华精华液| 一区二区三区四区亚洲| 在线亚洲精品福利网址导航| 亚洲精品中文在线影院| 欧美日韩夫妻久久| 久久99国产乱子伦精品免费| 久久婷婷色综合| 91麻豆6部合集magnet| 亚洲一区二区三区三| 欧美一区二区国产| 国产精品一品二品| 亚洲激情中文1区| 欧美一区二区国产| aaa欧美日韩| 国产日韩精品一区二区三区在线| 精品国产免费视频| 亚洲视频在线一区| 成人av在线电影| 国产欧美日韩中文久久| 风间由美一区二区三区在线观看| 欧美成人a在线| 国产一区二区三区在线看麻豆| 精品国产乱码久久久久久闺蜜| 久久99精品一区二区三区三区| 91精品国产综合久久精品麻豆| 日精品一区二区| 欧美激情一区二区三区全黄| av在线播放成人| 日韩国产在线观看一区| 精品久久一二三区| 色综合一个色综合| 美女视频网站久久| 亚洲精品乱码久久久久久久久 | 91麻豆精品国产| 紧缚捆绑精品一区二区| 亚洲国产成人在线| 欧美午夜精品免费| 国产自产视频一区二区三区| 亚洲欧美日韩国产中文在线| 欧美四级电影在线观看| 国产成人av一区二区三区在线| 亚洲青青青在线视频|