OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [httpd/] [current/] [src/] [monitor.c] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
/* =================================================================
2
 *
3
 *      monitor.c
4
 *
5
 *      An HTTP system monitor
6
 *
7
 * =================================================================
8
 * ####ECOSGPLCOPYRIGHTBEGIN####
9
 * -------------------------------------------
10
 * This file is part of eCos, the Embedded Configurable Operating System.
11
 * Copyright (C) 2002, 2003 Free Software Foundation, Inc.
12
 *
13
 * eCos is free software; you can redistribute it and/or modify it under
14
 * the terms of the GNU General Public License as published by the Free
15
 * Software Foundation; either version 2 or (at your option) any later
16
 * version.
17
 *
18
 * eCos is distributed in the hope that it will be useful, but WITHOUT
19
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21
 * for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with eCos; if not, write to the Free Software Foundation, Inc.,
25
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26
 *
27
 * As a special exception, if other files instantiate templates or use
28
 * macros or inline functions from this file, or you compile this file
29
 * and link it with other works to produce a work based on this file,
30
 * this file does not by itself cause the resulting work to be covered by
31
 * the GNU General Public License. However the source code for this file
32
 * must still be made available in accordance with section (3) of the GNU
33
 * General Public License v2.
34
 *
35
 * This exception does not invalidate any other reasons why a work based
36
 * on this file might be covered by the GNU General Public License.
37
 * -------------------------------------------
38
 * ####ECOSGPLCOPYRIGHTEND####
39
 * =================================================================
40
 * #####DESCRIPTIONBEGIN####
41
 *
42
 *  Author(s):    nickg@calivar.com
43
 *  Contributors: nickg@calivar.com, andrew.lunn@ascom.ch
44
 *  Date:         2002-10-14
45
 *  Purpose:
46
 *  Description:
47
 *
48
 * ####DESCRIPTIONEND####
49
 *
50
 * =================================================================
51
 */
52
 
53
#include <pkgconf/system.h>
54
#include <pkgconf/isoinfra.h>
55
#include <pkgconf/net.h>
56
#include <pkgconf/httpd.h>
57
#include <pkgconf/kernel.h>
58
 
59
#include <cyg/infra/cyg_trac.h>        /* tracing macros */
60
#include <cyg/infra/cyg_ass.h>         /* assertion macros */
61
 
62
#include <cyg/httpd/httpd.h>
63
 
64
#include <cyg/kernel/kapi.h>
65
#ifdef CYGPKG_KERNEL_INSTRUMENT
66
#include <cyg/kernel/instrmnt.h>
67
#include <cyg/kernel/instrument_desc.h>
68
#endif
69
 
70
#include <unistd.h>
71
#include <ctype.h>
72
 
73
/* ================================================================= */
74
/* Include all the necessary network headers by hand. We need to do
75
 * this so that _KERNEL is correctly defined, or not, for specific
76
 * headers so we can use both the external API and get at internal
77
 * kernel structures.
78
 */
79
 
80
#define _KERNEL
81
#include <sys/param.h>
82
#undef _KERNEL
83
#include <sys/socket.h>
84
#include <sys/ioctl.h>
85
#include <sys/errno.h>
86
#include <sys/time.h>
87
#include <netdb.h>
88
#define _KERNEL
89
 
90
#include <sys/sysctl.h>
91
#include <net/if.h>
92
#include <ifaddrs.h>
93
#include <netinet/in.h>
94
#include <netinet/ip.h>
95
#include <netinet/ip_icmp.h>
96
#include <net/route.h>
97
#include <net/if_dl.h>
98
 
99
#include <sys/protosw.h>
100
#include <netinet/in_pcb.h>
101
#include <netinet/udp.h>
102
#include <netinet/tcp.h>
103
#include <netinet/tcp_timer.h>
104
#include <netinet/ip_var.h>
105
#include <netinet/icmp_var.h>
106
#include <netinet/udp_var.h>
107
#include <netinet/tcp_var.h>
108
#ifdef CYGPKG_NET_INET6
109
#include <netinet/ip6.h>
110
#include <net/if_var.h>
111
#include <netinet6/ip6_var.h>
112
#include <netinet6/in6_var.h>
113
#include <netinet/icmp6.h>
114
#endif
115
 
116
 
117
#include <sys/mbuf.h>
118
 
119
#include <cyg/io/eth/eth_drv_stats.h>
120
 
121
/* ================================================================= */
122
/* Use this when a thread appears to have no name.
123
 */
124
 
125
#define NULL_THREAD_NAME "----------"
126
 
127
/* ================================================================= */
128
/* Draw navigation bar
129
 *
130
 * This draws a simple table containing links to the various monitor
131
 * pages at the current position in the HTML stream.
132
 */
133
 
134
static void draw_navbar( FILE *client )
135
{
136
    html_para_begin( client, "" );
137
 
138
    html_table_begin( client, "border cellpadding=\"4\"" );
139
    {
140
        html_table_row_begin(client, "" );
141
        {
142
            html_table_data_begin( client, "" );
143
            html_image( client, "/monitor/ecos.gif", "eCos logo", "" );
144
            html_table_data_begin( client, "" );
145
            html_url( client, "Threads", "/monitor/threads.html");
146
            html_table_data_begin( client, "" );
147
            html_url( client, "Interrupts", "/monitor/interrupts.html");
148
            html_table_data_begin( client, "" );
149
            html_url( client, "Memory", "/monitor/memory.html");
150
            html_table_data_begin( client, "" );
151
            html_url( client, "Network", "/monitor/network.html");
152
#ifdef CYGPKG_KERNEL_INSTRUMENT
153
            html_table_data_begin( client, "" );
154
            html_url( client, "Instrumentation", "/monitor/instrument.html");
155
#endif
156
        }
157
        html_table_row_end( client );
158
    }
159
    html_table_end( client );
160
}
161
 
162
/* ================================================================= */
163
/* Index page
164
 *
165
 * A simple introductory page matching "/monitor" and
166
 * "/monitor/index.html".
167
 */
168
 
169
static char monitor_index_blurb[] =
170
"<p>This is the eCos System Monitor. It presents a simple web monitor "
171
"and control interface for eCos systems.\n"
172
"<p>Use the navigation bar at the bottom of each page to explore."
173
;
174
 
175
static cyg_bool cyg_monitor_index( FILE * client, char *filename,
176
                                   char *formdata, void *arg )
177
{
178
    html_begin(client);
179
 
180
    html_head(client,"eCos System Monitor", "");
181
 
182
    html_body_begin(client,"");
183
    {
184
        html_heading(client, 2, "eCos System Monitor" );
185
 
186
        fputs( monitor_index_blurb, client );
187
 
188
        draw_navbar(client);
189
    }
190
    html_body_end(client);
191
 
192
    html_end(client);
193
 
194
    return 1;
195
}
196
 
197
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_entry,
198
                       "/monitor",
199
                       cyg_monitor_index,
200
                       NULL );
201
 
202
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_index_entry,
203
                       "/monitor/index.html",
204
                       cyg_monitor_index,
205
                       NULL );
206
 
207
/* ================================================================= */
208
/* Thread Monitor
209
 *
210
 * Uses the kapi thread info API to enumerate all the current threads
211
 * and generate a table showing their state.
212
 */
213
 
214
static cyg_bool cyg_monitor_threads( FILE * client, char *filename,
215
                                     char *formdata, void *arg )
216
{
217
 
218
    html_begin(client);
219
 
220
/*    html_head(client,"Thread Monitor", "<meta http-equiv=\"refresh\" content=\"10\">"); */
221
    html_head(client,"eCos Thread Monitor", "");
222
 
223
    html_body_begin(client,"");
224
    {
225
        html_heading(client, 2, "Thread Monitor" );
226
 
227
        html_table_begin( client, "border" );
228
        {
229
            cyg_handle_t thread = 0;
230
            cyg_uint16 id = 0;
231
 
232
            html_table_header( client, "Id", "" );
233
            html_table_header( client, "State", "" );
234
            html_table_header( client, "Set<br>Priority", "" );
235
            html_table_header( client, "Current<br>Priority", "" );
236
            html_table_header( client, "Name", "" );
237
            html_table_header( client, "Stack Base", "" );
238
            html_table_header( client, "Stack Size", "" );
239
#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
240
            html_table_header( client, "Stack Used", "" );
241
#endif
242
            /* Loop over the threads, and generate a table row for
243
             * each.
244
             */
245
            while( cyg_thread_get_next( &thread, &id ) )
246
            {
247
                cyg_thread_info info;
248
                char *state_string;
249
 
250
                cyg_thread_get_info( thread, id, &info );
251
 
252
                if( info.name == NULL )
253
                    info.name = NULL_THREAD_NAME;
254
 
255
                /* Translate the state into a string.
256
                 */
257
                if( info.state == 0 )
258
                    state_string = "RUN";
259
                else if( info.state & 0x04 )
260
                    state_string = "SUSP";
261
                else switch( info.state & 0x1b )
262
                {
263
                case 0x01: state_string = "SLEEP"; break;
264
                case 0x02: state_string = "CNTSLEEP"; break;
265
                case 0x08: state_string = "CREATE"; break;
266
                case 0x10: state_string = "EXIT"; break;
267
                default: state_string = "????"; break;
268
                }
269
 
270
                /* Now generate the row.
271
                 */
272
                html_table_row_begin(client, "" );
273
                {
274
                    html_table_data_begin( client, "" );
275
                    fprintf( client, "<a href=\"/monitor/thread-%04x.html\">%04x</a>\n", id,id);
276
                    html_table_data_begin( client, "" );
277
                    fprintf( client, "%s", state_string);
278
                    html_table_data_begin( client, "" );
279
                    fprintf( client, "%d", info.set_pri);
280
                    html_table_data_begin( client, "" );
281
                    fprintf( client, "%d", info.cur_pri);
282
                    html_table_data_begin( client, "" );
283
                    fputs( info.name, client );
284
                    html_table_data_begin( client, "" );
285
                    fprintf( client, "%08x", info.stack_base );
286
                    html_table_data_begin( client, "" );
287
                    fprintf( client, "%d", info.stack_size );
288
#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
289
                    html_table_data_begin( client, "" );
290
                    fprintf( client, "%d", info.stack_used );
291
#endif
292
                }
293
                html_table_row_end(client);
294
 
295
            }
296
        }
297
        html_table_end( client );
298
 
299
        draw_navbar(client);
300
    }
301
    html_body_end(client);
302
 
303
    html_end(client);
304
 
305
    return 1;
306
}
307
 
308
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_show_threads,
309
                       "/monitor/threads.htm*",
310
                       cyg_monitor_threads,
311
                       NULL );
312
 
313
/* ================================================================= */
314
/* Thread edit page
315
 *
316
 * A page on which the thread's state may be edited. This tests forms
317
 * handling.
318
 */
319
 
320
static char thread_edit_blurb[] =
321
"<p>This table contains an entry for each property of the thread "
322
"that you can edit. The properties are:\n"
323
"<p><b>State:</b> Change thread's state. The <em>Suspend</em> button "
324
"will suspend the thread. The <em>Run</em> button will undo any previous "
325
"suspends. The <em>Release</em> button will release the thread out of "
326
"any sleep it is currently in.\n"
327
"<p><b>Priority:</b> Change the thread's priority.\n"
328
"<p>Once the new state has been selected, press the <em>Submit</em> "
329
"button to make the change, or <em>Reset</em> to clear it."
330
;
331
 
332
static cyg_bool cyg_monitor_thread_edit( FILE * client, char *filename,
333
                                         char *formdata, void *arg )
334
{
335
    /* If any form data has been supplied, then change the thread's
336
     * state accordingly.
337
     */
338
    if( formdata != NULL )
339
    {
340
        char *formlist[6];
341
        char *state;
342
        char *pri_string;
343
        char *id_string;
344
        cyg_handle_t thread = 0;
345
        cyg_uint16 id;
346
 
347
        /* Parse the data */
348
        cyg_formdata_parse( formdata, formlist, 6 );
349
 
350
        /* Get the thread id from the hidden control */
351
        id_string = cyg_formlist_find( formlist, "thread");
352
 
353
        sscanf( id_string, "%04hx", &id );
354
 
355
        thread = cyg_thread_find( id );
356
 
357
        /* If there is a pri field, change the priority */
358
        pri_string = cyg_formlist_find( formlist, "pri");
359
 
360
        if( pri_string != NULL )
361
        {
362
            cyg_priority_t pri;
363
 
364
            sscanf( pri_string, "%d", &pri );
365
 
366
            cyg_thread_set_priority( thread, pri );
367
        }
368
 
369
        /* If there is a state field, change the thread state */
370
        state = cyg_formlist_find( formlist, "state");
371
 
372
        if( state != NULL )
373
        {
374
            if( strcmp( state, "run" ) == 0 )
375
                cyg_thread_resume( thread );
376
            if( strcmp( state, "suspend" ) == 0 )
377
                cyg_thread_suspend( thread );
378
            if( strcmp( state, "release" ) == 0 )
379
                cyg_thread_release( thread );
380
        }
381
    }
382
 
383
    /* Now generate a page showing the current thread state, and
384
     * including form controls to change it.
385
     */
386
 
387
    html_begin(client);
388
 
389
    html_head(client,"eCos Thread Editor", "");
390
 
391
    html_body_begin(client,"");
392
    {
393
        cyg_uint16 id;
394
        cyg_thread_info info;
395
        cyg_handle_t thread = 0;
396
        char idbuf[16];
397
 
398
        sscanf( filename, "/monitor/thread-%04hx.html", &id );
399
 
400
        thread = cyg_thread_find( id );
401
        cyg_thread_get_info(thread, id, &info );
402
 
403
        html_heading(client, 2, "Thread State Editor" );
404
 
405
        html_para_begin( client, "" );
406
 
407
        fprintf( client, "Editing Thread %04x %s\n",id,
408
                 info.name?info.name:NULL_THREAD_NAME);
409
 
410
        fputs( thread_edit_blurb, client );
411
 
412
        html_form_begin( client, filename, "" );
413
        {
414
            html_table_begin( client, "border" );
415
            {
416
                html_table_header( client, "Property", "" );
417
                html_table_header( client, "Value", "" );
418
 
419
                html_table_row_begin(client, "" );
420
                {
421
                    html_table_data_begin( client, "" );
422
                    fputs( "State", client );
423
 
424
                    html_table_data_begin( client, "" );
425
 
426
                    html_form_input_radio( client, "state", "run", (info.state&0x04)==0 );
427
                    fputs( "Run", client );
428
                    html_form_input_radio( client, "state", "suspend", (info.state&0x04)!=0 );
429
                    fputs( "Suspend", client );
430
                    html_form_input_radio( client, "state", "release", 0 );
431
                    fputs( "Release", client );
432
                }
433
                html_table_row_end( client );
434
 
435
                html_table_row_begin(client, "" );
436
                {
437
                    html_table_data_begin( client, "" );
438
                    fputs( "Priority", client );
439
 
440
                    html_table_data_begin( client, "" );
441
                    fprintf(client,"<input type=\"text\" name=\"pri\" size=\"10\" value=\"%d\">\n",
442
                            info.set_pri);
443
                }
444
                html_table_row_end( client );
445
 
446
            }
447
            html_table_end( client );
448
 
449
            /* Add submit and reset buttons */
450
            html_form_input(client, "submit", "submit", "Submit", "");
451
            html_form_input(client, "reset", "reset", "Reset", "");
452
 
453
            /* Pass the thread ID through to our next incarnation */
454
            sprintf( idbuf, "%04x", id );
455
            html_form_input_hidden(client, "thread", idbuf );
456
 
457
        }
458
        html_form_end( client );
459
 
460
        draw_navbar(client);
461
    }
462
    html_body_end(client);
463
 
464
    html_end(client);
465
 
466
    return 1;
467
}
468
 
469
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_thread_edit_entry,
470
                       "/monitor/thread-*",
471
                       cyg_monitor_thread_edit,
472
                       NULL );
473
 
474
/* ================================================================= */
475
/* Interrupt monitor
476
 *
477
 * At present this just generates a table showing which interrupts
478
 * have an ISR attached.
479
 */
480
 
481
static cyg_bool cyg_monitor_interrupts( FILE * client, char *filename,
482
                                        char *formdata, void *arg )
483
{
484
    html_begin(client);
485
 
486
    html_head(client,"eCos Interrupt Monitor", "");
487
 
488
    html_body_begin(client,"");
489
    {
490
        html_heading(client, 2, "Interrupt Monitor" );
491
 
492
        html_table_begin( client, "border" );
493
        {
494
            int i;
495
            int maxint = CYGNUM_HAL_ISR_MAX;
496
 
497
#ifdef CYGPKG_HAL_I386
498
            maxint = CYGNUM_HAL_ISR_MIN+16;
499
#endif
500
 
501
            html_table_header( client, "ISR", "" );
502
            html_table_header( client, "State", "" );
503
 
504
            for( i = CYGNUM_HAL_ISR_MIN; i <= maxint ; i++ )
505
            {
506
                cyg_bool_t inuse;
507
                HAL_INTERRUPT_IN_USE( i, inuse );
508
 
509
                html_table_row_begin(client, "" );
510
                {
511
                    html_table_data_begin( client, "" );
512
                    fprintf( client, "%d", i);
513
                    html_table_data_begin( client, "" );
514
                    fprintf( client, "%s", inuse?"In Use":"Free");
515
                }
516
                html_table_row_end( client );
517
            }
518
        }
519
        html_table_end( client );
520
 
521
        draw_navbar(client);
522
    }
523
    html_body_end(client);
524
 
525
    html_end(client);
526
 
527
    return 1;
528
 
529
}
530
 
531
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_interrupts_entry,
532
                       "/monitor/interrupts.htm*",
533
                       cyg_monitor_interrupts,
534
                       NULL );
535
 
536
/* ================================================================= */
537
/* Memory monitor
538
 *
539
 * Generates a table showing a 256 byte page of memory. Form controls
540
 * allow changes to the base address and display element size.
541
 */
542
 
543
static cyg_bool cyg_monitor_memory( FILE * client, char *filename,
544
                                    char *formdata, void *arg )
545
{
546
    char *formlist[10];
547
    cyg_uint32 base = 0;
548
    unsigned int datasize = 1;
549
    int size = 256;
550
    char *p;
551
    bool valid_base = true;
552
 
553
 
554
    cyg_formdata_parse( formdata, formlist, 10 );
555
 
556
    p = cyg_formlist_find( formlist, "base" );
557
 
558
    /* If the page is requested without a 'base' parameter, do not attempt
559
     * to access any memory locations to prevent illegal memory accesses
560
     * on targets where '0' is not a valid address.
561
     */
562
    if( p != NULL )
563
        sscanf( p, "%x", &base );
564
    else
565
        valid_base = false;
566
 
567
    p = cyg_formlist_find( formlist, "datasize" );
568
 
569
    if( p != NULL )
570
        sscanf( p, "%x", &datasize );
571
 
572
    if( cyg_formlist_find( formlist, "next" ) != NULL )
573
        base += size;
574
 
575
    if( cyg_formlist_find( formlist, "prev" ) != NULL )
576
        base -= size;
577
 
578
    html_begin(client);
579
 
580
    html_head(client,"eCos Memory Monitor", "");
581
 
582
    html_body_begin(client,"");
583
    {
584
        html_heading(client, 2, "Memory Monitor" );
585
 
586
        html_form_begin( client, "/monitor/memory.html", "" );
587
        {
588
 
589
            /* Text input control for base address
590
             */
591
            html_para_begin( client, "" );
592
            fprintf(client,
593
                    "Base Address: 0x<input type=\"text\" name=\"base\" size=\"10\" value=\"%x\">\n",
594
                    base);
595
 
596
            fprintf(client,
597
                    "WARNING: entering an illegal base address can crash the system.\n");
598
 
599
            /* A little menu for the element size
600
             */
601
            html_para_begin( client, "" );
602
 
603
            fputs( "Element Size: ", client );
604
            html_form_select_begin( client, "datasize", "" );
605
            html_form_option( client, "1", "bytes", datasize==1 );
606
            html_form_option( client, "2", "words", datasize==2 );
607
            html_form_option( client, "4", "dwords", datasize==4 );
608
            html_form_select_end( client );
609
 
610
            html_para_begin( client, "" );
611
 
612
            /* Submit and reset buttons
613
             */
614
            html_form_input(client, "submit", "submit", "Submit", "");
615
            html_form_input(client, "reset", "reset", "Reset", "");
616
 
617
            html_para_begin( client, "" );
618
 
619
            /* Previous page button */
620
            html_form_input(client, "submit", "prev", "Prev Page", "");
621
 
622
            /* Switch to monospaced font */
623
            cyg_html_tag_begin( client, "font", "face=\"monospace\"" );
624
 
625
            html_table_begin( client, "" );
626
 
627
            if (valid_base == true) {
628
                cyg_addrword_t loc;
629
                cyg_addrword_t oloc;
630
 
631
                for( oloc = loc = base; loc <= (base+size) ; loc++ )
632
                {
633
                    if( ( loc % 16 ) == 0 )
634
                    {
635
                        if( loc != base )
636
                        {
637
                            html_table_data_begin( client, "" );
638
                            for( ; oloc < loc; oloc++ )
639
                            {
640
                                char c = *(char *)oloc;
641
                                if( !isprint(c) )
642
                                    c = '.';
643
                                putc( c, client );
644
                            }
645
                            html_table_row_end( client );
646
                        }
647
                        if( loc == (base+size) )
648
                            break;
649
                        html_table_row_begin(client, "" );
650
                        html_table_data_begin( client, "" );
651
                        fprintf( client, "%08x:",loc);
652
                    }
653
 
654
                    html_table_data_begin( client, "" );
655
 
656
                    if( (loc % datasize) == 0 )
657
                    {
658
                        switch( datasize )
659
                        {
660
                        case 1: fprintf( client, "%02x", *(cyg_uint8  *)loc ); break;
661
                        case 2: fprintf( client, "%04x", *(cyg_uint16 *)loc ); break;
662
                        case 4: fprintf( client, "%08x", *(cyg_uint32 *)loc ); break;
663
                        }
664
                    }
665
                }
666
            }
667
            html_table_end( client );
668
            cyg_html_tag_end( client, "font" );
669
 
670
            html_form_input(client, "submit", "next", "Next Page", "");
671
        }
672
        html_form_end( client );
673
 
674
        draw_navbar(client);
675
    }
676
    html_body_end(client);
677
 
678
    html_end(client);
679
 
680
    return 1;
681
 
682
}
683
 
684
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_memory_entry,
685
                       "/monitor/memory.htm*",
686
                       cyg_monitor_memory,
687
                       NULL );
688
 
689
/* ================================================================= */
690
/* Network Monitor
691
 *
692
 * This function generates a page containing information about the
693
 * network interfaces and the protocols.
694
 */
695
 
696
static cyg_bool cyg_monitor_network( FILE * client, char *filename,
697
                                     char *formdata, void *arg )
698
{
699
    struct ifaddrs *iflist, *ifp;
700
 
701
    if(getifaddrs(&iflist)!=0)
702
        return 0;
703
 
704
    html_begin(client);
705
 
706
    html_head(client,"eCos Network Monitor", "");
707
 
708
    html_body_begin(client,"");
709
    {
710
        html_heading(client, 2, "Network Monitor" );
711
 
712
        html_heading(client, 3, "Interfaces" );
713
 
714
        html_table_begin( client, "border" );
715
        {
716
            char addr[64];
717
            int i;
718
            ifp = iflist;
719
 
720
            html_table_header( client, "Interface", "" );
721
            html_table_header( client, "Status", "" );
722
 
723
            while( ifp != (struct ifaddrs *)NULL)
724
            {
725
                if (ifp->ifa_addr->sa_family != AF_LINK)
726
                {
727
 
728
                  html_table_row_begin(client, "" );
729
                  {
730
                        html_table_data_begin( client, "" );
731
                        fprintf( client, "%s", ifp->ifa_name);
732
 
733
                        html_table_data_begin( client, "" );
734
                        html_table_begin( client, "" );
735
                        {
736
                            /* Get the interface's flags and display
737
                             * the interesting ones.
738
                             */
739
 
740
                            html_table_row_begin(client, "" );
741
                            fprintf( client, "<td>Flags<td>\n" );
742
                            for( i = 0; i < 16; i++ )
743
                              {
744
                                switch( ifp->ifa_flags & (1<<i) )
745
                                  {
746
                                  default: break;
747
                                  case IFF_UP: fputs( " UP", client ); break;
748
                                  case IFF_BROADCAST: fputs( " BROADCAST", client ); break;
749
                                  case IFF_DEBUG: fputs( " DEBUG", client ); break;
750
                                  case IFF_LOOPBACK: fputs( " LOOPBACK", client ); break;
751
                                  case IFF_PROMISC: fputs( " PROMISCUOUS", client ); break;
752
                                  case IFF_RUNNING: fputs( " RUNNING", client ); break;
753
                                  case IFF_SIMPLEX: fputs( " SIMPLEX", client ); break;
754
                                  case IFF_MULTICAST: fputs( " MULTICAST", client ); break;
755
                                  }
756
                              }
757
                            html_table_row_end( client );
758
 
759
                            html_table_row_begin(client, "" );
760
                            getnameinfo(ifp->ifa_addr, sizeof(*ifp->ifa_addr),
761
                                        addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
762
                            fprintf( client, "<td>Address<td>%s\n", addr);
763
                            html_table_row_end( client );
764
 
765
                            if (ifp->ifa_netmask)
766
                            {
767
                              html_table_row_begin(client, "" );
768
                              getnameinfo(ifp->ifa_netmask, sizeof(*ifp->ifa_netmask),
769
                                          addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
770
                              fprintf( client, "<td>Mask<td>%s\n", addr);
771
                              html_table_row_end( client );
772
                            }
773
 
774
                            if (ifp->ifa_broadaddr)
775
                            {
776
                              html_table_row_begin(client, "" );
777
                              getnameinfo(ifp->ifa_broadaddr, sizeof(*ifp->ifa_broadaddr),
778
                                          addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
779
                              fprintf( client, "<td>Broadcast<td>%s\n", addr);
780
                              html_table_row_end( client );
781
                            }
782
                        }
783
                        html_table_end( client );
784
                    }
785
                    html_table_row_end( client );
786
 
787
                }
788
                ifp = ifp->ifa_next;
789
            }
790
        }
791
        html_table_end( client );
792
 
793
        /* Now the protocols. For each of the main protocols: IP,
794
         * ICMP, UDP, TCP print a table of useful information derived
795
         * from the in-kernel data structures. Note that this only
796
         * works for the BSD stacks.
797
         */
798
 
799
        html_para_begin( client, "" );
800
        html_heading(client, 3, "Protocols" );
801
 
802
        html_para_begin( client, "" );
803
        html_table_begin( client, "border");
804
        {
805
            html_table_header( client, "IPv4", "" );
806
#ifdef CYGPKG_NET_INET6
807
            html_table_header( client, "IPv6", "" );
808
#endif            
809
            html_table_header( client, "ICMPv4", "" );
810
#ifdef CYGPKG_NET_INET6
811
            html_table_header( client, "ICMPv6", "" );
812
#endif            
813
            html_table_header( client, "UDP", "" );
814
            html_table_header( client, "TCP", "" );
815
 
816
            html_table_row_begin(client, "" );
817
            {
818
                html_table_data_begin( client, "valign=\"top\"" );
819
                html_table_begin( client, "" );
820
                {
821
 
822
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
823
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Total",
824
                             ipstat.ips_total );
825
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Bad",
826
                             ipstat.ips_badsum+
827
                             ipstat.ips_tooshort+
828
                             ipstat.ips_toosmall+
829
                             ipstat.ips_badhlen+
830
                             ipstat.ips_badlen+
831
                             ipstat.ips_noproto+
832
                             ipstat.ips_toolong
833
                        );
834
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Reassembled",
835
                             ipstat.ips_reassembled );
836
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Delivered",
837
                             ipstat.ips_delivered );
838
 
839
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
840
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Total",
841
                             ipstat.ips_localout );
842
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Raw",
843
                             ipstat.ips_rawout );
844
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Fragmented",
845
                             ipstat.ips_fragmented );
846
                }
847
                html_table_end( client );
848
#ifdef CYGPKG_NET_INET6
849
                html_table_data_begin( client, "valign=\"top\"" );
850
                html_table_begin( client, "" );
851
                {
852
 
853
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
854
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Total",
855
                             ip6stat.ip6s_total );
856
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Bad",
857
                             ip6stat.ip6s_tooshort+
858
                             ip6stat.ip6s_toosmall
859
                        );
860
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Reassembled",
861
                             ip6stat.ip6s_reassembled );
862
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Delivered",
863
                             ip6stat.ip6s_delivered );
864
 
865
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
866
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Total",
867
                             ip6stat.ip6s_localout );
868
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Raw",
869
                             ip6stat.ip6s_rawout );
870
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Fragmented",
871
                             ip6stat.ip6s_fragmented );
872
                }
873
                html_table_end( client );
874
#endif
875
                html_table_data_begin( client, "valign=\"top\"" );
876
                html_table_begin( client, "" );
877
                {
878
 
879
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
880
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "ECHO",
881
                             icmpstat.icps_inhist[ICMP_ECHO] );
882
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "ECHO REPLY",
883
                             icmpstat.icps_inhist[ICMP_ECHOREPLY] );
884
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "UNREACH",
885
                             icmpstat.icps_inhist[ICMP_UNREACH] );
886
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "REDIRECT",
887
                             icmpstat.icps_inhist[ICMP_REDIRECT] );
888
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Other",
889
                             icmpstat.icps_inhist[ICMP_SOURCEQUENCH]+
890
                             icmpstat.icps_inhist[ICMP_ROUTERADVERT]+
891
                             icmpstat.icps_inhist[ICMP_ROUTERSOLICIT]+
892
                             icmpstat.icps_inhist[ICMP_TIMXCEED]+
893
                             icmpstat.icps_inhist[ICMP_PARAMPROB]+
894
                             icmpstat.icps_inhist[ICMP_TSTAMP]+
895
                             icmpstat.icps_inhist[ICMP_TSTAMPREPLY]+
896
                             icmpstat.icps_inhist[ICMP_IREQ]+
897
                             icmpstat.icps_inhist[ICMP_IREQREPLY]+
898
                             icmpstat.icps_inhist[ICMP_MASKREQ]+
899
                             icmpstat.icps_inhist[ICMP_MASKREPLY]
900
                        );
901
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Bad",
902
                             icmpstat.icps_badcode+
903
                             icmpstat.icps_tooshort+
904
                             icmpstat.icps_checksum+
905
                             icmpstat.icps_badlen+
906
                             icmpstat.icps_bmcastecho
907
                        );
908
 
909
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
910
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "ECHO",
911
                             icmpstat.icps_outhist[ICMP_ECHO] );
912
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "ECHO REPLY",
913
                             icmpstat.icps_outhist[ICMP_ECHOREPLY] );
914
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "UNREACH",
915
                             icmpstat.icps_outhist[ICMP_UNREACH] );
916
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "REDIRECT",
917
                             icmpstat.icps_outhist[ICMP_REDIRECT] );
918
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Other",
919
                             icmpstat.icps_inhist[ICMP_SOURCEQUENCH]+
920
                             icmpstat.icps_outhist[ICMP_ROUTERADVERT]+
921
                             icmpstat.icps_outhist[ICMP_ROUTERSOLICIT]+
922
                             icmpstat.icps_outhist[ICMP_TIMXCEED]+
923
                             icmpstat.icps_outhist[ICMP_PARAMPROB]+
924
                             icmpstat.icps_outhist[ICMP_TSTAMP]+
925
                             icmpstat.icps_outhist[ICMP_TSTAMPREPLY]+
926
                             icmpstat.icps_outhist[ICMP_IREQ]+
927
                             icmpstat.icps_outhist[ICMP_IREQREPLY]+
928
                             icmpstat.icps_outhist[ICMP_MASKREQ]+
929
                             icmpstat.icps_outhist[ICMP_MASKREPLY]
930
                        );
931
                }
932
                html_table_end( client );
933
 
934
#ifdef CYGPKG_NET_INET6
935
                html_table_data_begin( client, "valign=\"top\"" );
936
                html_table_begin( client, "" );
937
                {
938
 
939
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
940
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "ECHO",
941
                             icmp6stat.icp6s_inhist[ICMP_ECHO] );
942
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "ECHO REPLY",
943
                             icmp6stat.icp6s_inhist[ICMP_ECHOREPLY] );
944
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "UNREACH",
945
                             icmp6stat.icp6s_inhist[ICMP_UNREACH] );
946
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "REDIRECT",
947
                             icmp6stat.icp6s_inhist[ICMP_REDIRECT] );
948
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Other",
949
                             icmp6stat.icp6s_inhist[ICMP_SOURCEQUENCH]+
950
                             icmp6stat.icp6s_inhist[ICMP_ROUTERADVERT]+
951
                             icmp6stat.icp6s_inhist[ICMP_ROUTERSOLICIT]+
952
                             icmp6stat.icp6s_inhist[ICMP_TIMXCEED]+
953
                             icmp6stat.icp6s_inhist[ICMP_PARAMPROB]+
954
                             icmp6stat.icp6s_inhist[ICMP_TSTAMP]+
955
                             icmp6stat.icp6s_inhist[ICMP_TSTAMPREPLY]+
956
                             icmp6stat.icp6s_inhist[ICMP_IREQ]+
957
                             icmp6stat.icp6s_inhist[ICMP_IREQREPLY]+
958
                             icmp6stat.icp6s_inhist[ICMP_MASKREQ]+
959
                             icmp6stat.icp6s_inhist[ICMP_MASKREPLY]
960
                        );
961
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Bad",
962
                             icmp6stat.icp6s_badcode+
963
                             icmp6stat.icp6s_tooshort+
964
                             icmp6stat.icp6s_checksum+
965
                             icmp6stat.icp6s_badlen
966
                        );
967
 
968
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
969
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "ECHO",
970
                             icmp6stat.icp6s_outhist[ICMP_ECHO] );
971
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "ECHO REPLY",
972
                             icmp6stat.icp6s_outhist[ICMP_ECHOREPLY] );
973
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "UNREACH",
974
                             icmp6stat.icp6s_outhist[ICMP_UNREACH] );
975
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "REDIRECT",
976
                             icmp6stat.icp6s_outhist[ICMP_REDIRECT] );
977
                    fprintf( client, "<tr><td>%s<td>%lld</tr>\n", "Other",
978
                             icmp6stat.icp6s_inhist[ICMP_SOURCEQUENCH]+
979
                             icmp6stat.icp6s_outhist[ICMP_ROUTERADVERT]+
980
                             icmp6stat.icp6s_outhist[ICMP_ROUTERSOLICIT]+
981
                             icmp6stat.icp6s_outhist[ICMP_TIMXCEED]+
982
                             icmp6stat.icp6s_outhist[ICMP_PARAMPROB]+
983
                             icmp6stat.icp6s_outhist[ICMP_TSTAMP]+
984
                             icmp6stat.icp6s_outhist[ICMP_TSTAMPREPLY]+
985
                             icmp6stat.icp6s_outhist[ICMP_IREQ]+
986
                             icmp6stat.icp6s_outhist[ICMP_IREQREPLY]+
987
                             icmp6stat.icp6s_outhist[ICMP_MASKREQ]+
988
                             icmp6stat.icp6s_outhist[ICMP_MASKREPLY]
989
                        );
990
                }
991
                html_table_end( client );
992
#endif
993
                html_table_data_begin( client, "valign=\"top\"" );
994
                html_table_begin( client, "" );
995
                {
996
 
997
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
998
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Total",
999
                             udpstat.udps_ipackets );
1000
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Bad",
1001
                             udpstat.udps_hdrops+
1002
                             udpstat.udps_badsum+
1003
                             udpstat.udps_badlen+
1004
                             udpstat.udps_noport+
1005
                             udpstat.udps_noportbcast+
1006
                             udpstat.udps_fullsock
1007
                        );
1008
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
1009
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Total",
1010
                             udpstat.udps_opackets );
1011
                }
1012
                html_table_end( client );
1013
 
1014
                html_table_data_begin( client, "valign=\"top\"" );
1015
                html_table_begin( client, "" );
1016
                {
1017
 
1018
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Connections" );
1019
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Initiated",
1020
                             tcpstat.tcps_connattempt );
1021
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Accepted",
1022
                             tcpstat.tcps_accepts );
1023
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Established",
1024
                             tcpstat.tcps_connects );
1025
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Closed",
1026
                             tcpstat.tcps_closed );
1027
 
1028
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
1029
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Packets",
1030
                             tcpstat.tcps_rcvtotal );
1031
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Data Packets",
1032
                             tcpstat.tcps_rcvpack );
1033
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Bytes",
1034
                             tcpstat.tcps_rcvbyte );
1035
 
1036
                    fprintf( client, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
1037
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Packets",
1038
                             tcpstat.tcps_sndtotal );
1039
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Data Packets",
1040
                             tcpstat.tcps_sndpack );
1041
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Bytes",
1042
                             tcpstat.tcps_sndbyte );
1043
 
1044
 
1045
                }
1046
                html_table_end( client );
1047
 
1048
 
1049
            }
1050
            html_table_row_end( client );
1051
 
1052
        }
1053
        html_table_end( client );
1054
 
1055
        html_para_begin( client, "" );
1056
        html_heading(client, 3, "Mbufs" );
1057
 
1058
        html_table_begin( client, "border" );
1059
        {
1060
            html_table_header( client, "Summary", "" );
1061
            html_table_header( client, "Types", "" );
1062
 
1063
            html_table_row_begin( client, "" );
1064
            {
1065
                html_table_data_begin( client, "valign=\"top\"" );
1066
                html_table_begin( client, "" );
1067
                {
1068
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Mbufs",
1069
                             mbstat.m_mbufs );
1070
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Clusters",
1071
                             mbstat.m_clusters );
1072
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Free Clusters",
1073
                             mbstat.m_clfree );
1074
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Drops",
1075
                             mbstat.m_drops );
1076
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Waits",
1077
                             mbstat.m_wait );
1078
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Drains",
1079
                             mbstat.m_drain );
1080
#if defined(CYGPKG_NET_FREEBSD_STACK)
1081
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Copy Fails",
1082
                             mbstat.m_mcfail );
1083
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "Pullup Fails",
1084
                             mbstat.m_mpfail );
1085
#endif                    
1086
 
1087
                }
1088
                html_table_end( client );
1089
 
1090
                html_table_data_begin( client, "valign=\"top\"" );
1091
                html_table_begin( client, "" );
1092
                {
1093
                    u_long *mtypes;
1094
#if defined(CYGPKG_NET_FREEBSD_STACK)
1095
                    mtypes = mbtypes;
1096
#else
1097
                    mtypes = mbstat.m_mtypes;
1098
#endif
1099
 
1100
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "FREE",
1101
                             mtypes[MT_FREE] );
1102
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "DATA",
1103
                             mtypes[MT_DATA] );
1104
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "HEADER",
1105
                             mtypes[MT_HEADER] );
1106
#if !defined(CYGPKG_NET_FREEBSD_STACK)                    
1107
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "SOCKET",
1108
                             mtypes[MT_SOCKET] );
1109
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "PCB",
1110
                             mtypes[MT_PCB] );
1111
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "RTABLE",
1112
                             mtypes[MT_RTABLE] );
1113
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "HTABLE",
1114
                             mtypes[MT_HTABLE] );
1115
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "ATABLE",
1116
                             mtypes[MT_ATABLE] );
1117
#endif
1118
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "SONAME",
1119
                             mtypes[MT_SONAME] );
1120
#if !defined(CYGPKG_NET_FREEBSD_STACK)                                        
1121
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "SOOPTS",
1122
                             mtypes[MT_SOOPTS] );
1123
#endif
1124
                    fprintf( client, "<tr><td>%s<td>%ld</tr>\n", "FTABLE",
1125
                             mtypes[MT_FTABLE] );
1126
 
1127
                    /* Ignore the rest for now... */
1128
 
1129
                }
1130
                html_table_end( client );
1131
 
1132
            }
1133
            html_table_row_end( client );
1134
 
1135
        }
1136
        html_table_end( client );
1137
 
1138
 
1139
        draw_navbar(client);
1140
    }
1141
    html_body_end(client);
1142
 
1143
    html_end(client);
1144
 
1145
    freeifaddrs(iflist);
1146
    return 1;
1147
 
1148
}
1149
 
1150
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_network_entry,
1151
                       "/monitor/network.htm*",
1152
                       cyg_monitor_network,
1153
                       NULL );
1154
 
1155
 
1156
/* ================================================================= */
1157
/* Instrumentation Monitor
1158
 *
1159
 * If the CYGPKG_KERNEL_INSTRUMENT option is set, we generate a table
1160
 * showing the current instrumentation buffer. If the FLAGS option is
1161
 * enabled we also print a table giving control of the flags.
1162
 *
1163
 */
1164
 
1165
#ifdef CYGPKG_KERNEL_INSTRUMENT
1166
 
1167
/* Instrumentation record. */
1168
struct Instrument_Record
1169
{
1170
    CYG_WORD16  type;                   // record type
1171
    CYG_WORD16  thread;                 // current thread id
1172
    CYG_WORD    timestamp;              // 32 bit timestamp
1173
    CYG_WORD    arg1;                   // first arg
1174
    CYG_WORD    arg2;                   // second arg
1175
};
1176
typedef struct Instrument_Record Instrument_Record;
1177
 
1178
/* Instrumentation variables, these live in the
1179
 * instrumentation files in the kernel
1180
 */
1181
__externC Instrument_Record       *instrument_buffer_pointer;
1182
__externC Instrument_Record       instrument_buffer[];
1183
__externC cyg_uint32              instrument_buffer_size;
1184
 
1185
#if defined(CYGDBG_KERNEL_INSTRUMENT_FLAGS) && \
1186
    defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1187
 
1188
static cyg_uint32 instrument_flags[(CYG_INSTRUMENT_CLASS_MAX>>8)+1];
1189
 
1190
#endif
1191
 
1192
static char cyg_monitor_instrument_blurb1[] =
1193
"<p>Use the checkboxes to enable the events to be recorded. Click "
1194
"the <em>Submit</em> button to start recording. Click the <em>Clear</em> "
1195
"button to clear all instrumentation and to stop recording."
1196
;
1197
 
1198
static cyg_bool cyg_monitor_instrument( FILE * client, char *filename,
1199
                                        char *formdata, void *arg )
1200
{
1201
 
1202
#if defined(CYGDBG_KERNEL_INSTRUMENT_FLAGS) && \
1203
    defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1204
 
1205
    /* Disable all instrumentation while we generate the page.
1206
     * Otherwise we could swamp the information we are really after.
1207
     */
1208
 
1209
    cyg_scheduler_lock();
1210
    {
1211
        struct instrument_desc_s *id = instrument_desc;
1212
        CYG_WORD cl = 0, ev = 0;
1213
 
1214
        for( ; id->msg != 0; id++ )
1215
        {
1216
            if( id->num > 0xff )
1217
            {
1218
                cl = id->num>>8;
1219
                instrument_flags[cl] = 0;
1220
            }
1221
            else
1222
            {
1223
                ev = id->num;
1224
                cyg_instrument_disable( cl<<8, ev );
1225
            }
1226
        }
1227
    }
1228
    cyg_scheduler_unlock();
1229
 
1230
#endif
1231
 
1232
    /* If we have some form data, deal with it.
1233
     */
1234
    if( formdata != NULL )
1235
    {
1236
        char *list[40];
1237
 
1238
        cyg_formdata_parse( formdata, list, sizeof(list)/sizeof(*list) );
1239
 
1240
#if defined(CYGDBG_KERNEL_INSTRUMENT_FLAGS) && \
1241
    defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1242
 
1243
        if( cyg_formlist_find( list, "clear" ) != NULL )
1244
        {
1245
            /* If the clear button is set, then disable all instrumentation flags.
1246
             */
1247
            int i;
1248
            for( i = 0; i < sizeof(instrument_flags)/sizeof(*instrument_flags); i++ )
1249
                instrument_flags[i] = 0;
1250
        }
1251
        else
1252
        {
1253
            /* Otherwise all the set checkboxes have been reported to
1254
             * us in the form of class=event inputs.
1255
             */
1256
            char **p;
1257
            for( p = list; *p != NULL; p++ )
1258
            {
1259
                int cl,ev;
1260
                if( sscanf( *p, "%02x=%02x", &cl, &ev ) == 2 )
1261
                    instrument_flags[cl] |= 1<<ev;
1262
            }
1263
        }
1264
#endif
1265
 
1266
        /* If the cleartable button has been pressed, clear all the
1267
         * table entries.
1268
         */
1269
        if( cyg_formlist_find( list, "cleartable" ) != NULL )
1270
        {
1271
            cyg_scheduler_lock();
1272
            {
1273
                Instrument_Record *ibp = instrument_buffer_pointer;
1274
                do
1275
                {
1276
                    ibp->type = 0;
1277
                    ibp++;
1278
                    if( ibp == &instrument_buffer[instrument_buffer_size] )
1279
                        ibp = instrument_buffer;
1280
 
1281
                } while( ibp != instrument_buffer_pointer );
1282
 
1283
            }
1284
            cyg_scheduler_unlock();
1285
        }
1286
    }
1287
 
1288
    /* Now start generating the HTML page.
1289
     */
1290
    html_begin(client);
1291
 
1292
    html_head(client,"eCos Instrumentation Buffer", "");
1293
 
1294
    html_body_begin(client,"");
1295
    {
1296
        html_heading(client, 2, "Instrumentation Buffer" );
1297
 
1298
        html_form_begin( client, "/monitor/instrument.html", "" );
1299
 
1300
#if defined(CYGDBG_KERNEL_INSTRUMENT_FLAGS) && \
1301
    defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1302
 
1303
        /* If we have the flags enabled, generate a table showing all
1304
         * the flag names with a checkbox against each.
1305
         */
1306
 
1307
        fputs( cyg_monitor_instrument_blurb1, client );
1308
 
1309
        html_para_begin( client, "" );
1310
        /* Add submit,clear and reset buttons */
1311
        html_form_input(client, "submit", "submit", "Submit", "");
1312
        html_form_input(client, "submit", "clear", "Clear", "");
1313
        html_form_input(client, "reset", "reset", "Reset", "");
1314
 
1315
        html_table_begin( client, "border width=100%" );
1316
        {
1317
            struct instrument_desc_s *id = instrument_desc;
1318
            CYG_WORD cl = 0, ev = 0;
1319
            int clc = 0;
1320
            char class[5], event[5];
1321
 
1322
            html_table_row_begin( client, "" );
1323
 
1324
            for( ; id->msg != 0; id++ )
1325
            {
1326
                if( id->num > 0xff )
1327
                {
1328
                    cl = id->num;
1329
                    sprintf( class, "%02x", cl>>8 );
1330
                    clc = 0;
1331
 
1332
                    if( id != instrument_desc )
1333
                    {
1334
                        html_table_end( client );
1335
                        html_table_row_end( client );
1336
                        html_table_row_begin( client, "" );
1337
                    }
1338
 
1339
                    html_table_data_begin( client, "valign=\"top\" width=100%" );
1340
                    html_table_begin( client, "width=100%" );
1341
                }
1342
                else
1343
                {
1344
                    ev = id->num;
1345
                    sprintf( event, "%02x", ev );
1346
 
1347
                    if( (clc%4) == 0 )
1348
                    {
1349
                        if( clc != 0 )
1350
                            html_table_row_end( client );
1351
 
1352
                        html_table_row_begin( client, "" );
1353
                    }
1354
                    clc++;
1355
                    html_table_data_begin( client, "width=25%" );
1356
                    html_form_input_checkbox( client, class, event,
1357
                                              instrument_flags[cl>>8] & (1<<ev) );
1358
                    fputs( id->msg, client );
1359
                }
1360
            }
1361
            html_table_end( client );
1362
            html_table_row_end( client );
1363
        }
1364
        html_table_end( client );
1365
 
1366
        /* Add submit,clear and reset buttons */
1367
        html_form_input(client, "submit", "submit", "Submit", "");
1368
        html_form_input(client, "submit", "clear", "Clear", "");
1369
        html_form_input(client, "reset", "reset", "Reset", "");
1370
 
1371
#endif
1372
 
1373
        html_para_begin( client, "" );
1374
 
1375
        html_form_input(client, "submit", "cleartable", "Clear Table", "");
1376
 
1377
 
1378
        /*
1379
         */
1380
 
1381
        html_table_begin( client, "border" );
1382
        {
1383
            Instrument_Record *ibp = instrument_buffer_pointer;
1384
 
1385
            html_table_header( client, "TIME", "" );
1386
            html_table_header( client, "THREAD", "" );
1387
            html_table_header( client, "EVENT", "" );
1388
            html_table_header( client, "ARG1", "" );
1389
            html_table_header( client, "ARG2", "" );
1390
 
1391
            do
1392
            {
1393
                if( ibp->type != 0 )
1394
                {
1395
                    html_table_row_begin(client, "" );
1396
                    {
1397
                        cyg_handle_t thread = cyg_thread_find(ibp->thread);
1398
                        cyg_thread_info info;
1399
 
1400
                        html_table_data_begin( client, "" );
1401
                        fprintf( client, "%08x",ibp->timestamp);
1402
                        html_table_data_begin( client, "" );
1403
                        if( thread != 0 &&
1404
                            cyg_thread_get_info( thread, ibp->thread, &info ) &&
1405
                            info.name != NULL )
1406
                            fputs( info.name, client );
1407
                        else fprintf( client, "[%04x]", ibp->thread);
1408
                        html_table_data_begin( client, "" );
1409
#if defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1410
                        fprintf( client, "%s", cyg_instrument_msg(ibp->type));
1411
#else
1412
                        fprintf( client, "%04x", ibp->type );
1413
#endif
1414
                        html_table_data_begin( client, "" );
1415
                        fprintf( client, "%08x", ibp->arg1);
1416
                        html_table_data_begin( client, "" );
1417
                        fprintf( client, "%08x", ibp->arg2);
1418
                    }
1419
                    html_table_row_end( client );
1420
                }
1421
                ibp++;
1422
                if( ibp == &instrument_buffer[instrument_buffer_size] )
1423
                    ibp = instrument_buffer;
1424
 
1425
            } while( ibp != instrument_buffer_pointer );
1426
        }
1427
        html_table_end( client );
1428
 
1429
        html_para_begin( client, "" );
1430
 
1431
        html_form_input(client, "submit", "cleartable", "Clear Table", "");
1432
 
1433
        html_form_end( client );
1434
 
1435
        draw_navbar(client);
1436
    }
1437
    html_body_end(client);
1438
 
1439
    html_end(client);
1440
 
1441
 
1442
#if defined(CYGDBG_KERNEL_INSTRUMENT_FLAGS) && \
1443
    defined(CYGDBG_KERNEL_INSTRUMENT_MSGS)
1444
 
1445
    /*
1446
     */
1447
 
1448
    cyg_scheduler_lock();
1449
    {
1450
        struct instrument_desc_s *id = instrument_desc;
1451
        CYG_WORD cl = 0, ev = 0;
1452
 
1453
        for( ; id->msg != 0; id++ )
1454
        {
1455
            if( id->num > 0xff )
1456
                cl = id->num>>8;
1457
            else
1458
            {
1459
                ev = id->num;
1460
                if( (instrument_flags[cl] & (1<<ev)) != 0 )
1461
                    cyg_instrument_enable( cl<<8, ev );
1462
            }
1463
        }
1464
    }
1465
    cyg_scheduler_unlock();
1466
#endif
1467
 
1468
    return true;
1469
}
1470
 
1471
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_instrument_entry,
1472
                       "/monitor/instrument.htm*",
1473
                       cyg_monitor_instrument,
1474
                       NULL );
1475
 
1476
#endif
1477
 
1478
/* ================================================================= */
1479
/* eCos Logo
1480
 *
1481
 * Define the logo as a byte array, and then define the data structure
1482
 * and table entry to allow it to be fetched by the client.
1483
 */
1484
 
1485
static cyg_uint8 ecos_logo_gif[] = {
1486
    0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x6f, 0x00, 0x23, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00,
1487
    0xff, 0xff, 0xff, 0xea, 0x19, 0x00, 0xcc, 0x00, 0x00, 0xfd, 0xfd, 0xfd, 0x83, 0x00, 0x00, 0xf6,
1488
    0xf6, 0xf6, 0x2f, 0x2f, 0x2f, 0xef, 0xef, 0xef, 0x19, 0x00, 0x19, 0x45, 0x45, 0x45, 0xbb, 0xbb,
1489
    0xbb, 0xe2, 0x3e, 0x3e, 0xe8, 0xbb, 0xd3, 0x3e, 0x3e, 0x3e, 0xfb, 0xfb, 0xfb, 0xbe, 0xbe, 0xbe,
1490
    0xf1, 0xed, 0xed, 0xe5, 0x7b, 0x8e, 0xe5, 0x6b, 0x7b, 0xcc, 0xcc, 0xcc, 0x98, 0x95, 0x98, 0xc6,
1491
    0xc3, 0xc6, 0x19, 0x19, 0x19, 0xf1, 0xf1, 0xf1, 0x98, 0x98, 0x98, 0xd6, 0xd3, 0xd6, 0x83, 0x83,
1492
    0x83, 0xde, 0xde, 0xde, 0xe5, 0x25, 0x25, 0x73, 0x6f, 0x73, 0xea, 0xea, 0xea, 0xe5, 0x8e, 0xa2,
1493
    0xe8, 0xe8, 0xe8, 0x7f, 0x7b, 0x7f, 0xe2, 0x56, 0x66, 0x8b, 0x8b, 0x8b, 0x19, 0x19, 0x00, 0xf8,
1494
    0xf8, 0xf8, 0x73, 0x73, 0x73, 0xd3, 0xd1, 0xd1, 0x9c, 0x9c, 0x9c, 0x50, 0x50, 0x50, 0xef, 0xce,
1495
    0xea, 0x92, 0x8e, 0x92, 0x6f, 0x6f, 0x6f, 0xe2, 0x2f, 0x2f, 0x61, 0x61, 0x61, 0xe5, 0xe5, 0xe5,
1496
    0xe8, 0x9f, 0xb8, 0x37, 0x2f, 0x37, 0x66, 0x66, 0x66, 0xe2, 0x4b, 0x50, 0x56, 0x50, 0x56, 0xa9,
1497
    0xa5, 0xa9, 0xce, 0xce, 0xce, 0x56, 0x50, 0x50, 0xd9, 0xd9, 0xd9, 0x77, 0x73, 0x77, 0x25, 0x25,
1498
    0x2f, 0x6b, 0x6b, 0x6b, 0x9f, 0x9f, 0x9f, 0x87, 0x83, 0x87, 0x3e, 0x37, 0x37, 0xf4, 0xf4, 0xf4,
1499
    0x25, 0x25, 0x25, 0xc1, 0xc1, 0xc1, 0x83, 0x7f, 0x83, 0xe5, 0xe2, 0xe2, 0x4b, 0x45, 0x4b, 0xd1,
1500
    0xce, 0xd1, 0xaf, 0xac, 0xaf, 0xcc, 0xc9, 0xcc, 0x5b, 0x56, 0x5b, 0xdb, 0xd9, 0xdb, 0x66, 0x61,
1501
    0x66, 0xe2, 0xe2, 0xe2, 0xb8, 0xb5, 0xb8, 0x2f, 0x25, 0x2f, 0xc3, 0xc1, 0xc3, 0xe0, 0xde, 0xe0,
1502
    0xd3, 0xd3, 0xd3, 0xde, 0xdb, 0xde, 0xac, 0xac, 0xac, 0xce, 0xcc, 0xce, 0x77, 0x6f, 0x73, 0x4b,
1503
    0x45, 0x45, 0xc9, 0xc6, 0xc9, 0x45, 0x3e, 0x45, 0x61, 0x5b, 0x61, 0xb5, 0xb2, 0xb5, 0x3e, 0x00,
1504
    0x00, 0x8b, 0x87, 0x87, 0x95, 0x92, 0x95, 0xa2, 0x9f, 0xa2, 0xb8, 0xb8, 0xb8, 0x7b, 0x77, 0x7b,
1505
    0x9c, 0x98, 0x9c, 0x50, 0x4b, 0x50, 0x6f, 0x6b, 0x6f, 0x6b, 0x66, 0x6b, 0xac, 0xa9, 0xac, 0x8e,
1506
    0x8b, 0x8e, 0x8e, 0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xed, 0xed, 0xed, 0x50, 0x4b, 0x4b, 0x3e, 0x37,
1507
    0x3e, 0x95, 0x95, 0x95, 0xa5, 0xa2, 0xa5, 0x9f, 0x9c, 0x9f, 0xc1, 0xbe, 0xbe, 0x2f, 0x25, 0x25,
1508
    0xd3, 0xd1, 0xd3, 0xf4, 0xf1, 0xf4, 0xc6, 0xc6, 0xc6, 0x8e, 0x8e, 0x8e, 0x25, 0x19, 0x19, 0x66,
1509
    0x61, 0x61, 0xb2, 0xaf, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1510
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1511
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1512
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1513
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1514
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1515
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1516
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1517
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1518
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1519
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1520
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1521
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1522
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1523
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1524
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1525
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1526
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1527
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1528
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1529
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1530
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1531
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1532
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1533
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1534
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
1535
    0x00, 0x00, 0x6f, 0x00, 0x23, 0x00, 0x40, 0x08, 0xff, 0x00, 0x03, 0x08, 0x1c, 0x28, 0x10, 0x41,
1536
    0x8a, 0x17, 0x0e, 0x1c, 0x00, 0x58, 0xc8, 0xb0, 0xa1, 0xc3, 0x87, 0x10, 0x21, 0x12, 0x14, 0x28,
1537
    0xa0, 0xa2, 0xc5, 0x8b, 0x18, 0x33, 0x6a, 0xdc, 0xb8, 0x91, 0x01, 0x83, 0x11, 0x31, 0x26, 0x12,
1538
    0x44, 0x10, 0x91, 0xe1, 0x09, 0x91, 0x28, 0x03, 0x4c, 0xb9, 0x50, 0x72, 0xa1, 0x0a, 0x04, 0x29,
1539
    0x09, 0x72, 0x6c, 0x10, 0x73, 0xe2, 0x88, 0x8d, 0x2e, 0x0c, 0xd4, 0x0c, 0x70, 0x73, 0x63, 0x80,
1540
    0x88, 0x10, 0x76, 0x0a, 0x6d, 0x18, 0x94, 0x60, 0x03, 0x8e, 0x1a, 0x27, 0x4a, 0x40, 0x5a, 0x51,
1541
    0xa9, 0xc5, 0x0e, 0x3b, 0x0d, 0x30, 0x40, 0xca, 0x40, 0x45, 0xc9, 0x14, 0x42, 0x45, 0x72, 0x60,
1542
    0xf9, 0xf0, 0x64, 0xd6, 0x00, 0x19, 0x3b, 0xe8, 0xfc, 0x3a, 0x70, 0xe9, 0x45, 0x10, 0x59, 0x0d,
1543
    0x70, 0x9c, 0x30, 0xf1, 0x44, 0xcb, 0xb7, 0x70, 0x4b, 0x8a, 0x64, 0x4a, 0xb7, 0xae, 0x5d, 0x01,
1544
    0x6c, 0x51, 0xbe, 0x88, 0xcb, 0xb7, 0xef, 0xc2, 0xb9, 0x77, 0x03, 0x0b, 0xbe, 0x98, 0x37, 0xc0,
1545
    0x81, 0x88, 0x58, 0x09, 0xde, 0xe0, 0xea, 0xf0, 0xc5, 0x44, 0x0e, 0x0f, 0x13, 0x13, 0x34, 0x30,
1546
    0x21, 0x23, 0xdb, 0x8c, 0x63, 0x07, 0x4a, 0xcd, 0x88, 0xd6, 0xa9, 0x45, 0x9a, 0x04, 0x69, 0x60,
1547
    0xec, 0xc0, 0x94, 0x41, 0x44, 0xaf, 0x03, 0x53, 0xf8, 0xdd, 0xd1, 0x10, 0xf5, 0xc0, 0xa9, 0x76,
1548
    0x41, 0x0f, 0x24, 0xcd, 0xb1, 0xf3, 0xc0, 0x9e, 0x1c, 0x25, 0x88, 0xac, 0xac, 0x91, 0x41, 0x00,
1549
    0xc8, 0x6f, 0x77, 0x48, 0x9e, 0x78, 0xc3, 0xaa, 0xdf, 0x03, 0x27, 0xa6, 0x40, 0x28, 0x2a, 0x13,
1550
    0xe9, 0x08, 0xd9, 0x93, 0x41, 0xd0, 0xe6, 0xd8, 0x41, 0x42, 0x83, 0x15, 0x02, 0x0d, 0x34, 0xe0,
1551
    0x8d, 0x34, 0x73, 0x6a, 0xc6, 0x7e, 0xc3, 0x3b, 0xff, 0x04, 0x3c, 0xb8, 0x3c, 0x5d, 0xdb, 0x03,
1552
    0xb7, 0xc2, 0x7d, 0x91, 0x02, 0xa6, 0xe2, 0x13, 0xe0, 0xf9, 0x22, 0x3f, 0xe1, 0x9a, 0x22, 0xd3,
1553
    0x09, 0xd0, 0x03, 0x18, 0x00, 0x01, 0x9b, 0x2e, 0x48, 0xec, 0x01, 0x34, 0x10, 0xc3, 0x04, 0xd3,
1554
    0x69, 0xa4, 0xd3, 0x5e, 0x11, 0x39, 0x46, 0x96, 0x40, 0x53, 0x44, 0xa4, 0x02, 0x59, 0x1a, 0xe5,
1555
    0x97, 0x95, 0x68, 0x17, 0xd1, 0x80, 0x92, 0x77, 0xfd, 0x69, 0x34, 0x81, 0x83, 0x6d, 0x25, 0xe4,
1556
    0xe1, 0x87, 0x0e, 0x3c, 0x48, 0x90, 0x6a, 0x0c, 0x89, 0x48, 0x10, 0x77, 0x74, 0x85, 0x44, 0x10,
1557
    0x6e, 0x11, 0x4e, 0xd4, 0x9f, 0x84, 0x2b, 0x10, 0x68, 0x97, 0x69, 0x10, 0x31, 0x27, 0xd0, 0x72,
1558
    0x38, 0xe6, 0xa8, 0x63, 0x8e, 0x44, 0x4d, 0x74, 0xd4, 0x5d, 0x13, 0xa1, 0xe8, 0x13, 0x41, 0x31,
1559
    0x60, 0xe4, 0x02, 0x7a, 0x22, 0xa9, 0xd5, 0xd1, 0x61, 0x35, 0x4e, 0x84, 0x80, 0x42, 0x0e, 0x5d,
1560
    0x70, 0x83, 0x48, 0xac, 0xf5, 0xe8, 0xa3, 0x46, 0x2e, 0xac, 0x30, 0x9a, 0x48, 0x45, 0x66, 0xc4,
1561
    0x80, 0x77, 0x01, 0x74, 0x69, 0x91, 0x75, 0x05, 0x0a, 0x80, 0xa4, 0x59, 0x5e, 0x92, 0x54, 0x92,
1562
    0x94, 0x5f, 0x3d, 0xf9, 0x16, 0x09, 0x59, 0x6d, 0x44, 0x03, 0x98, 0x31, 0xfd, 0x48, 0x58, 0x56,
1563
    0x20, 0x20, 0x45, 0x90, 0x71, 0xe2, 0xf5, 0x39, 0xde, 0x44, 0xe6, 0x05, 0xea, 0xdf, 0x4e, 0x1c,
1564
    0x90, 0xe0, 0x40, 0x95, 0x7e, 0xf2, 0x45, 0x9e, 0xa0, 0xe6, 0x75, 0xc0, 0x80, 0x04, 0x00, 0x0a,
1565
    0x85, 0x00, 0x82, 0x89, 0x86, 0xb7, 0x28, 0xa3, 0x82, 0x4e, 0x40, 0x27, 0x41, 0x94, 0x56, 0x2a,
1566
    0xde, 0xa5, 0x98, 0x32, 0x5a, 0x58, 0x6a, 0x7d, 0xed, 0x90, 0x10, 0x93, 0x9e, 0x02, 0x00, 0x2a,
1567
    0x47, 0x2e, 0x78, 0x14, 0x2a, 0x53, 0xb6, 0x75, 0xff, 0x0a, 0x91, 0x03, 0x53, 0xc6, 0x84, 0x00,
1568
    0x09, 0x7c, 0x5d, 0x70, 0x82, 0x7b, 0x29, 0x21, 0x25, 0xc1, 0xa6, 0x03, 0x35, 0x90, 0x61, 0x46,
1569
    0x2e, 0x48, 0x18, 0xec, 0xb0, 0x16, 0xb1, 0x45, 0x62, 0x44, 0x70, 0x92, 0xb5, 0x58, 0x49, 0x0a,
1570
    0x0a, 0xb5, 0x91, 0xb1, 0x31, 0xa1, 0x79, 0x11, 0xb5, 0x03, 0x69, 0xc9, 0x51, 0x0c, 0x50, 0x3e,
1571
    0x74, 0x01, 0xaf, 0x05, 0x9d, 0x80, 0xaa, 0x0a, 0x36, 0x0a, 0x24, 0x2b, 0x00, 0xdf, 0xa2, 0xb4,
1572
    0x82, 0x04, 0x13, 0x4c, 0x00, 0x02, 0x80, 0x96, 0xa1, 0xb4, 0x5d, 0xbb, 0x20, 0xd0, 0xa9, 0xe4,
1573
    0x98, 0x3e, 0xd2, 0x46, 0x43, 0x03, 0x76, 0x76, 0x24, 0x17, 0x41, 0xea, 0x31, 0x3b, 0x11, 0x9f,
1574
    0xe8, 0xa2, 0xe4, 0xc2, 0x46, 0x2c, 0x0a, 0x30, 0xc2, 0x44, 0x06, 0x1c, 0xac, 0x21, 0xc3, 0xd7,
1575
    0x4e, 0x24, 0xe6, 0x8c, 0x02, 0x2f, 0xe8, 0x64, 0x43, 0xcd, 0x36, 0x67, 0xd7, 0x44, 0xda, 0x72,
1576
    0x64, 0x21, 0x41, 0x68, 0xea, 0x96, 0xd2, 0x76, 0x74, 0xd1, 0xf8, 0x50, 0xb9, 0x16, 0xff, 0xc4,
1577
    0x50, 0xb9, 0xfd, 0x32, 0xe5, 0x42, 0x90, 0x74, 0x5d, 0x69, 0xd1, 0xc2, 0x3b, 0x21, 0x6b, 0x91,
1578
    0xc9, 0x0e, 0x65, 0x2c, 0x10, 0xaa, 0xe2, 0x4d, 0xc1, 0x71, 0x60, 0x32, 0xb3, 0xea, 0x59, 0x46,
1579
    0x20, 0x6d, 0x6a, 0xb3, 0x00, 0x38, 0x37, 0xb4, 0x83, 0x48, 0xdd, 0x46, 0x09, 0x62, 0x42, 0x4a,
1580
    0x8b, 0xd4, 0x31, 0xb1, 0x18, 0x89, 0x1c, 0x2c, 0x47, 0xbe, 0x01, 0x7a, 0xde, 0xd0, 0x18, 0x31,
1581
    0xd0, 0x74, 0x43, 0x0e, 0xa0, 0x34, 0x85, 0x0a, 0x87, 0x39, 0x40, 0x02, 0xb8, 0x02, 0xe1, 0xea,
1582
    0x50, 0xd8, 0x49, 0x4a, 0x00, 0x1b, 0x0d, 0x9d, 0x71, 0x96, 0xe4, 0x04, 0x53, 0x75, 0x00, 0x37,
1583
    0x4a, 0x05, 0x42, 0xa5, 0x9f, 0xdb, 0x15, 0x8d, 0x61, 0x2a, 0xd0, 0xd1, 0x0c, 0x2c, 0x0b, 0x51,
1584
    0xad, 0x6d, 0xf2, 0xec, 0xd0, 0x70, 0x35, 0x61, 0x69, 0x71, 0xcb, 0x7a, 0x0b, 0x65, 0x2d, 0x46,
1585
    0x21, 0x11, 0x0c, 0x91, 0xce, 0x29, 0x41, 0x80, 0x68, 0x4b, 0x0e, 0xa0, 0xac, 0x35, 0x96, 0xd8,
1586
    0x96, 0xd5, 0x51, 0xe7, 0x8f, 0x63, 0x44, 0x73, 0x00, 0x6e, 0xc5, 0xa5, 0x02, 0x09, 0xa8, 0x93,
1587
    0xf0, 0xc2, 0xe5, 0x7e, 0xae, 0x1a, 0xd6, 0x08, 0x12, 0xc4, 0x2e, 0x01, 0x85, 0xaf, 0x66, 0x64,
1588
    0x75, 0x41, 0x5f, 0xa7, 0xaa, 0xe8, 0xe6, 0xb5, 0x0b, 0x3a, 0x3a, 0x4a, 0x37, 0xe4, 0xae, 0xfb,
1589
    0xbf, 0x1a, 0xf7, 0x3e, 0x18, 0x0d, 0x91, 0x0e, 0x14, 0x10, 0x00, 0x3b
1590
};
1591
 
1592
CYG_HTTPD_DATA( cyg_monitor_ecos_logo_data,
1593
                "image/gif",
1594
                sizeof(ecos_logo_gif), ecos_logo_gif );
1595
 
1596
CYG_HTTPD_TABLE_ENTRY( cyg_monitor_ecos_logo,
1597
                       "/monitor/ecos.gif",
1598
                       cyg_httpd_send_data,
1599
                       &cyg_monitor_ecos_logo_data );
1600
 
1601
/*------------------------------------------------------------------ */
1602
/* end of monitor.c                                                  */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.