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

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

?? telnet_server.pc

?? simulator for ad hoc
?? PC
字號:
/* * GloMoSim is COPYRIGHTED software.  Release 2.02 of GloMoSim is available  * at no cost to educational users only. * * Commercial use of this software requires a separate license.  No cost, * evaluation licenses are available for such purposes; please contact * info@scalable-networks.com * * By obtaining copies of this and any other files that comprise GloMoSim2.02, * you, the Licensee, agree to abide by the following conditions and * understandings with respect to the copyrighted software: * * 1.Permission to use, copy, and modify this software and its documentation *   for education and non-commercial research purposes only is hereby granted *   to Licensee, provided that the copyright notice, the original author's *   names and unit identification, and this permission notice appear on all *   such copies, and that no charge be made for such copies. Any entity *   desiring permission to use this software for any commercial or *   non-educational research purposes should contact:  * *   Professor Rajive Bagrodia  *   University of California, Los Angeles  *   Department of Computer Science  *   Box 951596  *   3532 Boelter Hall  *   Los Angeles, CA 90095-1596  *   rajive@cs.ucla.edu * * 2.NO REPRESENTATIONS ARE MADE ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY *   PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. * * 3.Neither the software developers, the Parallel Computing Lab, UCLA, or any *   affiliate of the UC system shall be liable for any damages suffered by *   Licensee from the use of this software. */// Use the latest version of Parsec if this line causes a compiler error./* * $Id: telnet_server.pc,v 1.15 2001/02/15 03:17:26 mineo Exp $ * * This file contains initialization function, message processing * function, and finalize function used by telnet server.  */#include <stdlib.h>#include <stdio.h>#include <string.h>#include <assert.h> #include "api.h"#include "structmsg.h"#include "fileio.h"#include "message.h"#include "application.h"#include "app_util.h"#include "telnet_server.h"#include "tcpapps.h"#include "tcp.h"/* * NAME:        AppLayerTelnetServer. * PURPOSE:     Models the behaviour of Telnet server on receiving the *              message encapsulated in msg. * PARAMETERS:  nodePtr - pointer to the node which received the message. *              msg - message received by the layer * RETURN:      none. */void AppLayerTelnetServer(GlomoNode *nodePtr, Message *msg){    char buf[GLOMO_MAX_STRING_LENGTH];    GlomoAppTelnetServer *serverPtr;    ctoa(simclock(), buf);    switch(msg->eventType)     {        case MSG_APP_FromTransListenResult:         {            TransportToAppListenResult *listenResult;            listenResult = (TransportToAppListenResult *) msg->info;             #ifdef DEBUG                printf("%s: node %u got listenResult\n",                        buf, nodePtr->nodeAddr);            #endif            if (listenResult->connectionId == -1)            {                nodePtr->appData.numAppTcpFailure ++;            }            break;        }        case MSG_APP_FromTransOpenResult:         {            TransportToAppOpenResult *openResult;            openResult = (TransportToAppOpenResult *) msg->info;             #ifdef DEBUG                printf("%s: node %u got OpenResult\n", buf, nodePtr->nodeAddr);            #endif            assert(openResult->type == TCP_CONN_PASSIVE_OPEN);            if (openResult->connectionId < 0)             {                nodePtr->appData.numAppTcpFailure ++;            }             else             {                GlomoAppTelnetServer *serverPtr;                 serverPtr = AppTelnetServerNewTelnetServer(nodePtr, openResult);                assert(serverPtr != NULL);            }            break;        }        case MSG_APP_FromTransDataSent:        {            TransportToAppDataSent *dataSent;            dataSent = (TransportToAppDataSent *) msg->info;                    #ifdef DEBUG                printf("%s: node %u sent data %ld\n", buf, nodePtr->nodeAddr,                       dataSent->length);             #endif            serverPtr = AppTelnetServerGetTelnetServer(nodePtr,                                         dataSent->connectionId);            assert(serverPtr != NULL);            serverPtr->numBytesSent += dataSent->length;            break;        }          case MSG_APP_FromTransDataReceived:         {            TransportToAppDataReceived *dataRecvd;            dataRecvd = (TransportToAppDataReceived *) msg->info;            #ifdef DEBUG                printf("%s: node %u received data %ld\n",                        buf, nodePtr->nodeAddr, msg->packetSize);            #endif            serverPtr = AppTelnetServerGetTelnetServer(nodePtr,                                                        dataRecvd->connectionId);            assert(serverPtr != NULL);            serverPtr->numBytesRecvd += msg->packetSize;            if (msg->packet[msg->packetSize - 1] == 'c')             {                /*                  * Client wants to close the session, so server also                 * initiates a close.                 */                AppTcpCloseConnection(nodePtr, TRANSPORT_PROTOCOL_TCP,                                    serverPtr->connectionId);                serverPtr->sessionFinish = simclock();                serverPtr->sessionIsClosed = TRUE;            }             else if (msg->packet[msg->packetSize - 1] == 'd')             {                /* Send a response packet back. */                if (serverPtr->sessionIsClosed == FALSE)                {                    AppTelnetServerSendResponse(nodePtr, serverPtr);                 }            }            else            {                assert(0);            }            break;        }        case MSG_APP_FromTransCloseResult:        {            TransportToAppCloseResult *closeResult;            closeResult = (TransportToAppCloseResult *) msg->info;            #ifdef DEBUG                printf("%s: node %u got close result\n",                        buf, nodePtr->nodeAddr);            #endif            serverPtr = AppTelnetServerGetTelnetServer(nodePtr,                                                  closeResult->connectionId);            assert(serverPtr != NULL);            if (serverPtr->sessionIsClosed == FALSE)             {                serverPtr->sessionIsClosed = TRUE;                serverPtr->sessionFinish = simclock();            }            break;        }        default:            ctoa(simclock(), buf);            printf("Time %s: Node %u received message of unknown type"                   " %ld.\n", buf, nodePtr->nodeAddr, msg->eventType);            assert(FALSE);    }    GLOMO_MsgFree(nodePtr, msg);}/* * NAME:        AppTelnetServerInit.  * PURPOSE:     listen on Telnet server port.  * PARAMETERS:  nodePtr - pointer to the node. * RETURN:      none.  */voidAppTelnetServerInit(GlomoNode *nodePtr){    AppTcpServerListen(nodePtr,                        TRANSPORT_PROTOCOL_TCP,                        APP_TELNET_SERVER,                       nodePtr->nodeAddr,                        (short)APP_TELNET_SERVER);}/* * NAME:        AppTelnetServerFinalize.  * PURPOSE:     Collect statistics of a Telnet session.  * PARAMETERS:  nodePtr - pointer to the node. *              serverPtr - pointer to the telnet server data structure.  * RETURN:      none.  */voidAppTelnetServerFinalize(GlomoNode *nodePtr, GlomoAppTelnetServer *serverPtr){    clocktype throughput;    char clockStr[GLOMO_MAX_STRING_LENGTH];    char startStr[GLOMO_MAX_STRING_LENGTH];    char closeStr[GLOMO_MAX_STRING_LENGTH];    char buf[GLOMO_MAX_STRING_LENGTH];    char throughputStr[GLOMO_MAX_STRING_LENGTH];    ctoa(serverPtr->sessionStart, startStr);    if (serverPtr->sessionIsClosed == FALSE)     {        serverPtr->sessionFinish = simclock();        ctoa(simclock(), clockStr);        sprintf(closeStr, "%s ns (not closed)", clockStr);    }     else     {        ctoa(serverPtr->sessionFinish, clockStr);        sprintf(closeStr, "%s ns (closed)", clockStr);    }    if (serverPtr->sessionFinish <= serverPtr->sessionStart)     {        throughput = 0;     }     else     {        throughput = (serverPtr->numBytesRecvd * 8.0 * SECOND) /                     (serverPtr->sessionFinish - serverPtr->sessionStart);    }    ctoa(throughput, throughputStr);    sprintf(buf, "from %ld to %ld (cid = %d), start = %s, end = %s, "            "bytes sent = %ld B, bytes recv =  %ld B, throughput = %s bps",            serverPtr->remoteAddr, serverPtr->localAddr,             serverPtr->connectionId, startStr, closeStr,            serverPtr->numBytesSent, serverPtr->numBytesRecvd,            throughputStr);    GLOMO_PrintStat(nodePtr, "AppTelnetServer", buf);}/* * NAME:        AppTelnetServerGetTelnetServer. * PURPOSE:     search for a telnet server data structure.  * PARAMETERS:  nodePtr - pointer to the node,  *              connId - connection ID of the telnet server.  * RETURN:      the pointer to the telnet server data structure, *              NULL if nothing found. */static GlomoAppTelnetServer *AppTelnetServerGetTelnetServer(GlomoNode *nodePtr, int connId){    AppInfo *appList = nodePtr->appData.appPtr;    GlomoAppTelnetServer *telnetServer;        for (; appList != NULL; appList = appList->appNext)     {        if (appList->appType == APP_TELNET_SERVER)         {            telnetServer = (GlomoAppTelnetServer *) appList->appDetail;            if (telnetServer->connectionId == connId)             {                return telnetServer;            }        }    }    return NULL;}/* * NAME:        AppTelnetServerNewTelnetServer. * PURPOSE:     create a new telnet server data structure, place it                at the beginning of the application list.  * PARAMETERS:  nodePtr - pointer to the node,  *              openResult - result of the open request.  * RETRUN:      the pointer to the created telnet server data structure, *              NULL if no data structure allocated.  */static GlomoAppTelnetServer *AppTelnetServerNewTelnetServer(GlomoNode *nodePtr,                                TransportToAppOpenResult *openResult){    AppInfo *newApp;    GlomoAppTelnetServer *telnetServer;    newApp = (AppInfo *) pc_malloc(sizeof(AppInfo));    if (newApp == NULL)     {        assert(FALSE);    }    telnetServer = (GlomoAppTelnetServer *)                     pc_malloc(sizeof(GlomoAppTelnetServer));    /*     * fill in connection id, etc.     */    newApp->appType = APP_TELNET_SERVER;    telnetServer->connectionId = openResult->connectionId;    telnetServer->localAddr = openResult->localAddr;    telnetServer->remoteAddr = openResult->remoteAddr;    telnetServer->sessionStart = simclock();    telnetServer->sessionFinish = 0;     telnetServer->sessionIsClosed = FALSE;     telnetServer->numBytesSent = 0;    telnetServer->numBytesRecvd = 0;    newApp->appDetail = telnetServer;    newApp->appNext = nodePtr->appData.appPtr;     nodePtr->appData.appPtr = newApp;    return telnetServer;}/* * NAME:        AppTelnetServerSendResponse. * PURPOSE:     call AppTelnetServerRespPktSize() to get the  *              response packet size,                 and send the packet.  * PARAMETERS:  nodePtr - pointer to the node,  *              serverPtr - pointer to the server data structure.  * RETRUN:      none.  */static voidAppTelnetServerSendResponse(GlomoNode *nodePtr, GlomoAppTelnetServer *serverPtr){    int pktSize;    char payload[MAX_APP_DATA_UNIT];    pktSize = AppTelnetServerRespPktSize(nodePtr);    AppTcpSendData(nodePtr, TRANSPORT_PROTOCOL_TCP, serverPtr->connectionId,                    payload, pktSize);}/* * NAME:        AppTelnetServerRespPktSize. * PURPOSE:     call tcplib function telnet_pktsize(). * PARAMETERS:  nodePtr - pointer to the node. * RETRUN:      telnet control packet size. */static int AppTelnetServerRespPktSize(GlomoNode *nodePtr){    int ctrlPktSize;    ctrlPktSize = telnet_pktsize(nodePtr->seed);    #ifdef DEBUG        printf("TELNET control pktsize = %d\n", ctrlPktSize);    #endif    return (ctrlPktSize);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线精品一区二区三区| 美女诱惑一区二区| 欧美人成免费网站| 国产在线播放一区三区四| 亚洲人成人一区二区在线观看 | 亚洲日本va在线观看| 欧美乱妇一区二区三区不卡视频| 亚洲黄色片在线观看| 日韩亚洲国产中文字幕欧美| 成人sese在线| 免费成人美女在线观看.| 亚洲女爱视频在线| 精品黑人一区二区三区久久 | 精品久久99ma| 在线视频综合导航| 国产乱码精品1区2区3区| 亚洲蜜桃精久久久久久久| 国产午夜精品理论片a级大结局| 欧美综合久久久| 国产成人av一区二区| 亚洲欧美日韩中文播放| 国产精品三级久久久久三级| 日韩一区二区在线免费观看| 91国内精品野花午夜精品| 成人av在线一区二区| 免费av网站大全久久| 亚洲精品写真福利| 久久女同精品一区二区| 欧美大片拔萝卜| 欧美日韩国产在线播放网站| 成人精品gif动图一区| 国产精品影视网| 日本欧美久久久久免费播放网| 亚洲六月丁香色婷婷综合久久| 亚洲精品一区二区精华| 日韩欧美久久一区| 7777精品伊人久久久大香线蕉最新版 | 国产精品久久免费看| 日韩视频一区在线观看| 91麻豆精品国产91久久久使用方法| 91麻豆蜜桃一区二区三区| 国产不卡视频在线播放| 国产精品一区二区三区网站| 美女高潮久久久| 亚洲成人免费电影| 亚洲最新视频在线观看| 亚洲在线一区二区三区| 亚洲欧美一区二区三区极速播放| 精品国产成人在线影院| 久久免费视频色| 欧美大片国产精品| 日韩三级电影网址| 在线欧美一区二区| 欧美日韩一二区| 欧美日本精品一区二区三区| 欧美四级电影网| 5858s免费视频成人| 91精品国产日韩91久久久久久| 欧美性受极品xxxx喷水| 欧美性xxxxx极品少妇| 欧美精品一二三| 欧美精品高清视频| 制服.丝袜.亚洲.中文.综合| 色婷婷久久久亚洲一区二区三区| 在线观看欧美日本| 欧美午夜片在线看| 91精品国产欧美日韩| 日韩免费视频一区| 欧美精品一区男女天堂| 久久久亚洲精华液精华液精华液| 久久午夜色播影院免费高清| 亚洲欧美怡红院| 综合电影一区二区三区 | 99免费精品在线观看| 99久久99久久精品免费看蜜桃| 99re这里只有精品首页| av色综合久久天堂av综合| 欧美日韩精品欧美日韩精品| 欧美一区二区在线免费观看| 欧美一区永久视频免费观看| 一区二区三区中文字幕| 美女在线观看视频一区二区| 国产精品中文欧美| kk眼镜猥琐国模调教系列一区二区| 播五月开心婷婷综合| 欧美吞精做爰啪啪高潮| 日韩一区和二区| 国产精品丝袜在线| 亚洲国产一区二区在线播放| 久久精工是国产品牌吗| 波多野结衣欧美| 日韩欧美123| 亚洲少妇30p| 日本欧美一区二区| 狠狠色狠狠色综合| 色综合久久88色综合天天免费| 欧美午夜精品久久久| 337p日本欧洲亚洲大胆色噜噜| 最新成人av在线| 三级欧美在线一区| 91玉足脚交白嫩脚丫在线播放| 欧美日韩在线播放一区| xvideos.蜜桃一区二区| 亚洲一区二区三区视频在线| 老司机精品视频导航| 色av成人天堂桃色av| 日韩精品一区二区在线| 亚洲精品成a人| 春色校园综合激情亚洲| 欧美一级日韩不卡播放免费| 亚洲欧洲日韩女同| 国产高清精品在线| 777午夜精品免费视频| 中文字幕一区二区三区在线播放| 亚洲精品国久久99热| www.在线成人| 久久新电视剧免费观看| 亚洲成a天堂v人片| 色av成人天堂桃色av| 国产精品乱人伦一区二区| 午夜精品久久久久久久99水蜜桃| 奇米综合一区二区三区精品视频 | 欧美日本在线播放| 国产精品国产三级国产aⅴ原创| 美女一区二区视频| 在线免费观看日本欧美| 亚洲国产精品v| 九九在线精品视频| 91麻豆免费视频| 国产精品你懂的在线欣赏| 国产综合色在线视频区| 欧美二区三区的天堂| 亚洲精品视频一区| jlzzjlzz亚洲日本少妇| 亚洲三级久久久| 成人a级免费电影| 国产亚洲一区二区三区| 国产尤物一区二区| 精品国产区一区| 日本不卡1234视频| 94-欧美-setu| 亚洲线精品一区二区三区八戒| 99re这里只有精品首页| 国产精品麻豆网站| 色网站国产精品| 亚洲综合免费观看高清完整版在线 | 久久99精品久久久久婷婷| 欧美日韩免费在线视频| 亚洲国产精品久久久久婷婷884| 欧美日韩国产免费| 美女视频一区二区| 国产性色一区二区| 99精品久久99久久久久| 亚洲一区二区综合| 欧美一区二区精品在线| 国产麻豆视频一区二区| 国产视频一区二区在线| 97久久超碰国产精品| 丝袜亚洲另类欧美| 国产日韩v精品一区二区| 91麻豆视频网站| 日韩精品国产精品| 国产日韩欧美一区二区三区乱码| 91丨国产丨九色丨pron| 午夜视频一区在线观看| 久久综合九色综合97婷婷女人| 成人aa视频在线观看| 亚洲亚洲人成综合网络| 欧美电影精品一区二区| 91在线国产观看| 日韩av一区二区在线影视| 国产欧美久久久精品影院| 一本到一区二区三区| 五月婷婷综合网| 国产欧美一区二区三区在线看蜜臀 | 亚洲精品欧美二区三区中文字幕| 欧美欧美欧美欧美首页| 国产成人欧美日韩在线电影| 亚洲国产欧美一区二区三区丁香婷 | 欧美网站一区二区| 国产福利视频一区二区三区| 亚洲男人都懂的| 精品免费视频.| 在线视频国内一区二区| 国产尤物一区二区| 日日摸夜夜添夜夜添亚洲女人| 国产午夜精品美女毛片视频| 欧美精品 日韩| 欧洲av在线精品| 美女视频黄久久| 亚洲一区二区五区| 久久精品一级爱片| 欧美日韩成人在线一区| av福利精品导航| 看片的网站亚洲| 亚洲在线视频免费观看| 日本一区二区电影| 欧美大度的电影原声| 欧美少妇一区二区| 成人国产精品免费网站|