⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app_ping.h

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 H
字号:
/*
 * FILENAME: app_ping.h
 *
 * Copyright  2000 By InterNiche Technologies Inc. All rights reserved
 *
 * Header file for  app_ping.c
 * NOTE - this file may by included even if PING_APP is not defined in the
 * system build, since UDP_ECHO and others use some of these values.
 *
 * MODULE: TCP
 *
 * PORTABLE: yes
 */

#ifndef APP_PING_H
#define  APP_PING_H     1

#include "in_utils.h"

struct PingInfo 
{
   u_long   delay;         /* delay between 2 pings */
   int      length;        /* ping packet length */
   ip_addr  ipadd;   
   u_long   nextping;      /* cticks value to do next ping */
   long     times;         /* number of times to ping */
   int      out;
   int      in;
   GEN_IO   pio;           /* To communicate with invocator of ping */
   struct PingInfo * next; /* Next ping packet */
};

typedef struct PingInfo * PING_INFO ;

extern   ip_addr  activehost; /* default ping host */

#define  TIMEFOR1TICK      (1000/TPS)  /* Time between each tick in millisecs */


int         ping_init(void);
PING_INFO   ping_new (void);
int         ping_delete(PING_INFO p);
int         ping_addq(PING_INFO p);
int         ping_delq(PING_INFO p);
PING_INFO   ping_search(GEN_IO pio);
int         ping_start(void * pio);
int         ping_send(PING_INFO p);
int         ping_end(void * pio);
int         ping_setdelay(void * pio);
int         ping_setlength(void * pio);   /* menu routine to set default ping size*/
int         ping_sethost(void * pio);     /* set default host for pings, et.al. */
int         pingUpcall(PACKET p);
void        ping_check(void);
PING_INFO   ping_demux(ip_addr fhost);
int         ping_stats(void * pio);

#define     PING_ALLOC(size)  npalloc(size) 
#define     PING_FREE(ptr)    npfree(ptr)

#define     PINGERRBASE       200

/* List of error codes returned by ping_delq() */
#define     PING_DELQ_BAD_OBJECT       (PINGERRBASE+11)
#define     PING_DELQ_Q_EMPTY          (PINGERRBASE+12)
#define     PING_DELQ_OBJ_NOT_FOUND    (PINGERRBASE+13)

/* List of error codes returned by ping_delete() */
#define     PING_DEL_NULL_ARGUMENT     (PINGERRBASE+21)

/* List of error codes returned by ping_start() */
#define     PING_ST_NOIP               (PINGERRBASE+31)
#define     PING_ST_BAD_ARG2           (PINGERRBASE+32)
#define     PING_ST_ALLOC_ERR          (PINGERRBASE+33)

/* List of error codes returned by ping_end() */
#define     PING_END_NO_SESSION        (PINGERRBASE+41)

/* List of error codes returned by ping_setdelay() */
#define     PING_DELAY_BAD_ARG         (PINGERRBASE+51)

/* List of error codes returned by ping_setlength() */
#define     PING_LEN_BAD_ARG           (PINGERRBASE+61)

#endif   /* APP_PING_H */

⌨️ 快捷键说明

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