ipripng_cmd_show.c

来自「这是最新的vxWorks6.7协议栈下的RIPng(rip over ipv6)」· C语言 代码 · 共 171 行

C
171
字号
/* * Copyright 2006 Wind River Systems, Inc. * * The right to copy, distribute, modify or otherwise make use * of this software may be licensed only pursuant to the terms * of an applicable Wind River license agreement. *//*modification history--------------------01a,12jun06,tlu  Initial creation *//* **************************************************************************** * 1                    DESCRIPTION **************************************************************************** * Implementation of ripng shell command to use for IPRIPng show routines * or telnet shell management. * * 'ripngctrl'   A command to print RIPng route entries and RIPng interfaces. * *//* **************************************************************************** * 2                    CONFIGURATION **************************************************************************** */#include "ipripng_config.h"/* **************************************************************************** * 3                    INCLUDE FILES **************************************************************************** */#define IPCOM_USE_ANDORNOT#define IPCOM_USE_CLIB_PROTO#include <ipcom_clib.h>#include <ipcom_err.h>#include <ipcom_getopt.h>#include "ipripng.h"/* **************************************************************************** * 4                    EXTERN PROTOTYPES **************************************************************************** */IP_GLOBAL void ipripng_rtdump(void);IP_GLOBAL void ipripng_ifdump(void);IP_GLOBAL Ip_err ripngStart(char *  cmdString, int priority);IP_GLOBAL void ripngStop(void);/* **************************************************************************** * 5                    DEFINES **************************************************************************** *//* **************************************************************************** * 6                    TYPES **************************************************************************** *//* **************************************************************************** * 7                    LOCAL PROTOTYPES **************************************************************************** */IP_PUBLIC int ipripng_cmd_ripngctrl(int argc, char **argv);/* **************************************************************************** * 8                    DATA **************************************************************************** *//* **************************************************************************** * 9                   FUNCTIONS **************************************************************************** *//* *=========================================================================== *                         ipripng_cmd_ripngctrl *=========================================================================== * Description:   The 'ripngctrl' shell command. A command to print RIPng routes *                and interfaces. * Parameters:    Standard argc, argv * Returns:       0. * */IP_PUBLIC intipripng_cmd_ripngctrl(int argc, char **argv){    if(argc == 1)        goto usage;    /*********** rtprint ***********/    if(ipcom_strcmp(argv[1], "rtprint") == 0)    {        ipripng_rtdump();    }    /*********** ifprint ***********/    else if(ipcom_strcmp(argv[1], "ifprint") == 0)    {        ipripng_ifdump();    }    /*********** ripngStart ********/    else if(ipcom_strcmp(argv[1], "ripngStart") == 0)    {        if (argc != 4)	    goto usage;	ripngStart((char *)argv[2], ipcom_atoi(argv[3]));    }    /*********** ripngStop ********/    else if(ipcom_strcmp(argv[1], "ripngStop") == 0)    {        ripngStop();    }    else    {        goto usage;    }    return 0; usage:    ipcom_printf("usage: ripngctrl rtprint"IP_LF		 "                 ifprint"IP_LF		 "                 ripngStart '[options]' [priority]"IP_LF		 "                 ripngStop"IP_LF);    return 0;}/* **************************************************************************** *                      END OF FILE **************************************************************************** */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?