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

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

?? monitor.c

?? 嵌入式操作系統ECOS的網絡開發包
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* =================================================================
 *
 *      monitor.c
 *
 *      An HTTP system monitor 
 *
 * ================================================================= 
 * ####ECOSGPLCOPYRIGHTBEGIN####
 * -------------------------------------------
 * This file is part of eCos, the Embedded Configurable Operating
 * System.
 * Copyright (C) 2002 Nick Garnett.
 * 
 * eCos 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 or (at your option)
 * any later version.
 * 
 * eCos 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 eCos; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 * 
 * As a special exception, if other files instantiate templates or
 * use macros or inline functions from this file, or you compile this
 * file and link it with other works to produce a work based on this
 * file, this file does not by itself cause the resulting work to be
 * covered by the GNU General Public License. However the source code
 * for this file must still be made available in accordance with
 * section (3) of the GNU General Public License.
 * 
 * This exception does not invalidate any other reasons why a work
 * based on this file might be covered by the GNU General Public
 * License.
 *
 * -------------------------------------------
 * ####ECOSGPLCOPYRIGHTEND####
 * =================================================================
 * #####DESCRIPTIONBEGIN####
 * 
 *  Author(s):    nickg@calivar.com
 *  Contributors: nickg@calivar.com
 *  Date:         2002-10-14
 *  Purpose:      
 *  Description:  
 *               
 * ####DESCRIPTIONEND####
 * 
 * =================================================================
 */

#include <pkgconf/system.h>
#include <pkgconf/isoinfra.h>
#include <pkgconf/net.h>
#include <pkgconf/httpd.h>
#include <pkgconf/kernel.h>

#include <cyg/infra/cyg_trac.h>        /* tracing macros */
#include <cyg/infra/cyg_ass.h>         /* assertion macros */

#include <cyg/httpd/httpd.h>

#include <cyg/kernel/kapi.h>
#ifdef CYGPKG_KERNEL_INSTRUMENT
#include <cyg/kernel/instrmnt.h>
#include <cyg/kernel/instrument_desc.h>
#endif

#include <unistd.h>
#include <ctype.h>

/* ================================================================= */
/* Include all the necessary network headers by hand. We need to do
 * this so that _KERNEL is correctly defined, or not, for specific
 * headers so we can use both the external API and get at internal
 * kernel structures.
 */

#define _KERNEL
#include <sys/param.h>
#undef _KERNEL
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <sys/time.h>

#define _KERNEL

#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <net/route.h>
#include <net/if_dl.h>

#include <sys/protosw.h>
#include <netinet/in_pcb.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <netinet/tcp_timer.h>
#include <netinet/ip_var.h>
#include <netinet/icmp_var.h>
#include <netinet/udp_var.h>
#include <netinet/tcp_var.h>

#include <cyg/io/eth/eth_drv_stats.h>

/* ================================================================= */
/* Use this when a thread appears to have no name.
 */

#define NULL_THREAD_NAME "----------"

/* ================================================================= */
/* Draw navigation bar
 *
 * This draws a simple table containing links to the various monitor
 * pages at the current position in the HTML stream.
 */

static void draw_navbar( FILE *client )
{
    html_para_begin( client, "" );
    
    html_table_begin( client, "border cellpadding=\"4\"" );
    {
        html_table_row_begin(client, "" );
        {
            html_table_data_begin( client, "" );
            html_image( client, "/monitor/ecos.gif", "eCos logo", "" );
            html_table_data_begin( client, "" );
            html_url( client, "Threads", "/monitor/threads.html");
            html_table_data_begin( client, "" );
            html_url( client, "Interrupts", "/monitor/interrupts.html");
            html_table_data_begin( client, "" );
            html_url( client, "Memory", "/monitor/memory.html");
            html_table_data_begin( client, "" );
            html_url( client, "Network", "/monitor/network.html");
#ifdef CYGPKG_KERNEL_INSTRUMENT
            html_table_data_begin( client, "" );
            html_url( client, "Instrumentation", "/monitor/instrument.html");
#endif
        }
        html_table_row_end( client );
    }
    html_table_end( client );
}

/* ================================================================= */
/* Index page
 *
 * A simple introductory page matching "/monitor" and
 * "/monitor/index.html".
 */

static char monitor_index_blurb[] =
"<p>This is the eCos System Monitor. It presents a simple web monitor
and control interface for eCos systems.\n"
"<p>Use the navigation bar at the bottom of each page to explore."
;

static cyg_bool cyg_monitor_index( FILE * client, char *filename,
                                   char *formdata, void *arg )
{
    html_begin(client);

    html_head(client,"eCos System Monitor", "");    

    html_body_begin(client,"");
    {
        html_heading(client, 2, "eCos System Monitor" );

        fputs( monitor_index_blurb, client );
        
        draw_navbar(client);
    }
    html_body_end(client);

    html_end(client);
    
    return 1;
}

CYG_HTTPD_TABLE_ENTRY( cyg_monitor_entry,
                       "/monitor",
                       cyg_monitor_index,
                       NULL );

CYG_HTTPD_TABLE_ENTRY( cyg_monitor_index_entry,
                       "/monitor/index.html",
                       cyg_monitor_index,
                       NULL );

/* ================================================================= */
/* Thread Monitor
 *
 * Uses the kapi thread info API to enumerate all the current threads
 * and generate a table showing their state.
 */

static cyg_bool cyg_monitor_threads( FILE * client, char *filename,
                                     char *formdata, void *arg )
{
    
    html_begin(client);

/*    html_head(client,"Thread Monitor", "<meta http-equiv=\"refresh\" content=\"10\">"); */
    html_head(client,"eCos Thread Monitor", "");    

    html_body_begin(client,"");
    {
        html_heading(client, 2, "Thread Monitor" );

        html_table_begin( client, "border" );
        {
            cyg_handle_t thread = 0;
            cyg_uint16 id = 0;
        
            html_table_header( client, "Id", "" );
            html_table_header( client, "State", "" );
            html_table_header( client, "Set<br>Priority", "" );
            html_table_header( client, "Current<br>Priority", "" );
            html_table_header( client, "Name", "" );
            html_table_header( client, "Stack Base", "" );
            html_table_header( client, "Stack Size", "" );
#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
            html_table_header( client, "Stack Used", "" );
#endif
            /* Loop over the threads, and generate a table row for
             * each.
             */
            while( cyg_thread_get_next( &thread, &id ) )
            {
                cyg_thread_info info;
                char *state_string;

                cyg_thread_get_info( thread, id, &info );
                
                if( info.name == NULL )
                    info.name = NULL_THREAD_NAME;

                /* Translate the state into a string.
                 */
                if( info.state == 0 )
                    state_string = "RUN";
                else if( info.state & 0x04 )
                    state_string = "SUSP";
                else switch( info.state & 0x1b )
                {
                case 0x01: state_string = "SLEEP"; break;
                case 0x02: state_string = "CNTSLEEP"; break;
                case 0x08: state_string = "CREATE"; break;
                case 0x10: state_string = "EXIT"; break;
                default: state_string = "????"; break;
                }

                /* Now generate the row.
                 */
                html_table_row_begin(client, "" );
                {
                    html_table_data_begin( client, "" );
                    fprintf( client, "<a href=\"/monitor/thread-%04x.html\">%04x</a>\n", id,id);
                    html_table_data_begin( client, "" );
                    fprintf( client, "%s", state_string);
                    html_table_data_begin( client, "" );
                    fprintf( client, "%d", info.set_pri);
                    html_table_data_begin( client, "" );
                    fprintf( client, "%d", info.cur_pri);
                    html_table_data_begin( client, "" );
                    fputs( info.name, client );
                    html_table_data_begin( client, "" );
                    fprintf( client, "%08x", info.stack_base );
                    html_table_data_begin( client, "" );
                    fprintf( client, "%d", info.stack_size );
#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
                    html_table_data_begin( client, "" );
                    fprintf( client, "%d", info.stack_used );
#endif
                }
                html_table_row_end(client);
                
            }
        }
        html_table_end( client );

        draw_navbar(client);
    }
    html_body_end(client);

    html_end(client);
    
    return 1;
}

CYG_HTTPD_TABLE_ENTRY( cyg_monitor_show_threads,
                       "/monitor/threads.htm*",
                       cyg_monitor_threads,
                       NULL );

/* ================================================================= */
/* Thread edit page
 *
 * A page on which the thread's state may be edited. This tests forms
 * handling.
 */

static char thread_edit_blurb[] =
"<p>This table contains an entry for each property of the thread
that you can edit. The properties are:\n"
"<p><b>State:</b> Change thread's state. The <em>Suspend</em> button
will suspend the thread. The <em>Run</em> button will undo any previous
suspends. The <em>Release</em> button will release the thread out of
any sleep it is currently in.\n"
"<p><b>Priority:</b> Change the thread's priority.\n"
"<p>Once the new state has been selected, press the <em>Submit</em>
button to make the change, or <em>Reset</em> to clear it."
;

static cyg_bool cyg_monitor_thread_edit( FILE * client, char *filename,
                                         char *formdata, void *arg )
{
    /* If any form data has been supplied, then change the thread's
     * state accordingly.
     */
    if( formdata != NULL )
    {
        char *formlist[6];
        char *state;
        char *pri_string;
        char *id_string;
        cyg_handle_t thread = 0;
        cyg_uint16 id;

        /* Parse the data */
        cyg_formdata_parse( formdata, formlist, 6 );

        /* Get the thread id from the hidden control */
        id_string = cyg_formlist_find( formlist, "thread");

        sscanf( id_string, "%04hx", &id );

        thread = cyg_thread_find( id );

        /* If there is a pri field, change the priority */
        pri_string = cyg_formlist_find( formlist, "pri");

        if( pri_string != NULL )
        {
            cyg_priority_t pri;

            sscanf( pri_string, "%d", &pri );

            cyg_thread_set_priority( thread, pri );
        }

        /* If there is a state field, change the thread state */
        state = cyg_formlist_find( formlist, "state");

        if( state != NULL )
        {
            if( strcmp( state, "run" ) == 0 )
                cyg_thread_resume( thread );
            if( strcmp( state, "suspend" ) == 0 )
                cyg_thread_suspend( thread );
            if( strcmp( state, "release" ) == 0 )
                cyg_thread_release( thread );
        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品久久久久久动态图| 无吗不卡中文字幕| 欧美日韩大陆在线| 国产成人精品午夜视频免费| 亚洲午夜精品在线| 国产欧美一区二区精品久导航 | 欧美调教femdomvk| 成年人网站91| 韩国在线一区二区| 日韩精品三区四区| 亚洲欧美视频一区| 国产欧美一区二区精品性色超碰 | 欧美性感一类影片在线播放| 激情偷乱视频一区二区三区| 亚洲1区2区3区4区| 亚洲三级在线免费| 欧美高清在线精品一区| 欧美电视剧在线看免费| 欧美日韩国产综合久久 | 欧美日韩dvd在线观看| 99久久免费国产| 国产宾馆实践打屁股91| 精品一区二区三区在线播放| 亚洲超碰精品一区二区| 亚洲精品大片www| 久久久精品tv| 久久亚洲影视婷婷| 日韩三级.com| 日韩一区二区中文字幕| 6080午夜不卡| 538prom精品视频线放| 91国产成人在线| 91久久久免费一区二区| 91在线视频免费观看| 国产91精品精华液一区二区三区 | 丁香婷婷深情五月亚洲| 久久99蜜桃精品| 日本91福利区| 人禽交欧美网站| 美女视频黄久久| 日本成人中文字幕| 久久99国产精品成人| 奇米影视一区二区三区小说| 人人狠狠综合久久亚洲| 麻豆精品在线观看| 久久精品av麻豆的观看方式| 麻豆精品在线播放| 国产美女在线观看一区| 国产乱对白刺激视频不卡| 国内久久精品视频| 高清国产午夜精品久久久久久| 福利电影一区二区| 91丨九色丨尤物| 91福利精品视频| 91精品国产欧美一区二区| 日韩视频一区二区| 国产午夜精品福利| 国产精品高潮呻吟久久| 亚洲欧美色一区| 亚洲bdsm女犯bdsm网站| 麻豆精品久久久| 国产ts人妖一区二区| 北条麻妃国产九九精品视频| 日本韩国一区二区| 6080午夜不卡| 国产精品视频免费| 亚洲一区二区三区四区中文字幕| 日韩影院在线观看| 国产电影一区在线| 色屁屁一区二区| 欧美一级日韩不卡播放免费| 久久亚洲春色中文字幕久久久| 国产精品天干天干在线综合| 樱桃国产成人精品视频| 日韩精品电影在线观看| 国产成人精品免费| 在线观看成人小视频| 日韩一区二区精品在线观看| 国产人伦精品一区二区| 一区二区三区精密机械公司| 免费观看日韩电影| 国产成人午夜99999| 欧美午夜片在线观看| 精品福利在线导航| 亚洲一区二区欧美| 国产成人免费视频网站| 欧美性一二三区| 久久久一区二区三区| 亚洲电影在线播放| 成人精品视频网站| 91精品国产综合久久婷婷香蕉| 国产人成亚洲第一网站在线播放| 一区二区三区日本| 国产一区二区0| 91.com视频| 亚洲精品欧美综合四区| 国产资源在线一区| 欧美三级电影在线看| 国产视频在线观看一区二区三区| 亚洲成人av资源| 一本大道久久a久久精二百| 精品久久久久av影院| 亚洲午夜免费电影| 成人av片在线观看| 久久先锋影音av鲁色资源网| 亚洲超碰97人人做人人爱| 99久精品国产| 国产网红主播福利一区二区| 秋霞电影网一区二区| 色老汉一区二区三区| 国产日韩欧美不卡在线| 精品影视av免费| 91麻豆精品国产91久久久久久久久 | 婷婷成人综合网| 91国产丝袜在线播放| 国产精品成人免费| 国产福利一区二区三区| 欧美一区二区三区免费在线看| 亚洲精品videosex极品| 成人黄色在线看| 国产视频在线观看一区二区三区| 久久精品国产亚洲a| 欧美日韩久久久久久| 有坂深雪av一区二区精品| 99久久伊人久久99| 国产精品亲子乱子伦xxxx裸| 久久精品国内一区二区三区| 88在线观看91蜜桃国自产| 亚洲成人免费视频| 欧美午夜精品久久久久久超碰 | 国产精品一线二线三线| 日韩精品一区二区三区四区 | 久久久91精品国产一区二区精品| 久久爱www久久做| 精品国产伦一区二区三区观看体验 | 不卡免费追剧大全电视剧网站| 久久婷婷国产综合精品青草| 久久超碰97人人做人人爱| 欧美一区二区三区四区久久| 天天做天天摸天天爽国产一区| 欧美日韩一级片在线观看| 一区二区三区美女| 欧美日本一区二区在线观看| 天天做天天摸天天爽国产一区| 67194成人在线观看| 久久机这里只有精品| 2022国产精品视频| 国产成人免费视频| 中文字幕制服丝袜成人av| 91在线观看美女| 亚洲一二三专区| 欧美一区二区视频在线观看| 精品亚洲国内自在自线福利| 久久综合久久鬼色| 成人免费高清在线观看| 亚洲综合自拍偷拍| 在线不卡欧美精品一区二区三区| 日韩成人伦理电影在线观看| 精品国产一区二区三区久久久蜜月| 韩国v欧美v亚洲v日本v| 国产精品你懂的在线欣赏| 色呦呦国产精品| 天天免费综合色| 久久久蜜桃精品| 色一区在线观看| 日本欧美在线观看| 中文字幕不卡在线| 欧洲精品一区二区| 久久91精品国产91久久小草 | 亚洲综合视频在线| 欧美一区二区三区在线| 粉嫩av一区二区三区粉嫩| 亚洲精品高清在线观看| 日韩视频国产视频| 99在线热播精品免费| 日日嗨av一区二区三区四区| 欧美激情综合网| 精品视频资源站| 国产成人av一区二区三区在线观看| ...中文天堂在线一区| 欧美精品 国产精品| 国产91精品一区二区麻豆网站| 亚洲综合色丁香婷婷六月图片| 精品国产精品网麻豆系列| 99久久免费视频.com| 美国十次综合导航| 亚洲伊人色欲综合网| 久久嫩草精品久久久精品| 欧洲精品一区二区| 成人性色生活片免费看爆迷你毛片| 亚洲一卡二卡三卡四卡五卡| 国产午夜三级一区二区三| 欧美精品v国产精品v日韩精品 | 韩日精品视频一区| 亚洲国产日产av| 亚洲视频一二区| 久久午夜色播影院免费高清| 欧美日韩欧美一区二区| av动漫一区二区| 国产又黄又大久久|