?? pinglib.c
字號:
/* ############################################################################ (c) Copyright Virata Limited 2001## Virata Limited Confidential and Proprietary## The following software source code ("Software") is strictly confidential and# is proprietary to Virata Limited ("Virata"). It may only be read, used,# copied, adapted, modified or otherwise dealt with by you if you have# entered into a confidentiality agreement with Virata and then subject to the# terms of that confidentiality agreement and any other applicable agreement# between you and Virata. If you are in any doubt as to whether you are# entitled to access, read, use, copy, adapt, modify or otherwise deal with# the Software or whether you are entitled to disclose the Software to any# other person you should contact Virata. If you have not entered into a# confidentiality agreement with Virata granting access to this Software you# should forthwith return all media, copies and printed listings containing# the Software to Virata.## Virata reserves the right to take legal action against you should you breach# the above provisions.## If you are unsure, or to report violations, please contact# support@virata.com# ##########################################################################*//* * ping API -> message interface library */#include "config.h"#include "atypes.h"#include "kernel.h"#include "messages.h"#include "errno.h"#include "pingLib.h"static ATMOS_MQID ping_qid = 0;/* ping_v4_v6 -- * Ping the given destination address, if destination address is * IPv6 link-local interface name must be provided. Caller is * responsible for storage of the address string. * * PARAMETERS: * dest_addr - destination IPv4 or IPv6 address * ifname - outgoing interface name if destination address is * IPv6 link-local * * RETURNS: * error code */intping_v4_v6(const char *dest_addr, const char *ifname){ ATMOS_MESSAGE msg; MSG_D_PING(data, &msg); if (ping_qid == 0) { if ((ping_qid = atmos_findqueue("ping")) == 0) { return ENOTFOUND; } } data->dest_addr = dest_addr; data->ifname = ifname; sendwaitmessage(&msg, MSG_N_PING, ping_qid); return msg.errno;} /* ping_v4_v6 *//* ping -- * Ping the given destination address. Caller is responsible for * storage of the address string. For backward compatibility only. * * PARAMETERS: * dest_addr - destination IPv4 or IPv6 address * * RETURNS: * error code */intping(const char *dest_addr){ return ping_v4_v6(dest_addr, NULL);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -