00001 /* 00002 * Copyright (c) 2009 Lukas Mejdrech 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * - Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * - Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * - The name of the author may not be used to endorse or promote products 00015 * derived from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00020 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00028 00038 #ifndef LIBC_ICMP_MESSAGES_ 00039 #define LIBC_ICMP_MESSAGES_ 00040 00041 #include <ipc/net.h> 00042 #include <sys/types.h> 00043 #include <sys/time.h> 00044 #include <net/icmp_codes.h> 00045 00047 typedef enum { 00049 NET_ICMP_ECHO = NET_ICMP_FIRST, 00050 00055 NET_ICMP_DEST_UNREACH, 00056 00061 NET_ICMP_SOURCE_QUENCH, 00062 00067 NET_ICMP_TIME_EXCEEDED, 00068 00073 NET_ICMP_PARAMETERPROB 00074 } icmp_messages_t; 00075 00078 00084 #define ICMP_GET_CODE(call) ((icmp_code_t) IPC_GET_ARG1(call)) 00085 00091 #define ICMP_GET_MTU(call) ((icmp_param_t) IPC_GET_ARG3(call)) 00092 00098 #define ICMP_GET_POINTER(call) ((icmp_param_t) IPC_GET_ARG3(call)) 00099 00105 #define ICMP_GET_SIZE(call) ((size_t) IPC_GET_ARG1(call)) 00106 00112 #define ICMP_GET_TIMEOUT(call) ((suseconds_t) IPC_GET_ARG2(call)) 00113 00119 #define ICMP_GET_TTL(call) ((ip_ttl_t) IPC_GET_ARG3(call)) 00120 00126 #define ICMP_GET_TOS(call) ((ip_tos_t) IPC_GET_ARG4(call)) 00127 00132 #define ICMP_GET_DONT_FRAGMENT(call) ((int) IPC_GET_ARG5(call)) 00133 00136 #endif 00137