"Fossies" - the Fresh Open Source Software Archive

Member "bwping-1.15/include/cygwin.h" (1 May 2019, 3581 Bytes) of package /linux/privat/bwping-1.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cygwin.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.12_vs_1.14.

    1 #ifndef CYGWIN_H
    2 #define CYGWIN_H
    3 
    4 #ifndef ICMP_MINLEN
    5 #define ICMP_MINLEN 8
    6 #endif
    7 #ifndef ICMP_ECHO
    8 #define ICMP_ECHO 8
    9 #endif
   10 #ifndef ICMP_ECHOREPLY
   11 #define ICMP_ECHOREPLY 0
   12 #endif
   13 
   14 struct icmp_ra_addr
   15 {
   16     u_int32_t ira_addr;
   17     u_int32_t ira_preference;
   18 } __attribute__((packed));
   19 
   20 struct icmp
   21 {
   22     u_int8_t  icmp_type;  /* type of message, see below */
   23     u_int8_t  icmp_code;  /* type sub code */
   24     u_int16_t icmp_cksum; /* ones complement checksum of struct */
   25     union
   26     {
   27         u_char ih_pptr;             /* ICMP_PARAMPROB */
   28         struct in_addr ih_gwaddr;   /* gateway address */
   29         struct ih_idseq             /* echo datagram */
   30         {
   31             u_int16_t icd_id;
   32             u_int16_t icd_seq;
   33         } __attribute__((packed)) ih_idseq;
   34         u_int32_t ih_void;
   35 
   36         /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
   37         struct ih_pmtu
   38         {
   39             u_int16_t ipm_void;
   40             u_int16_t ipm_nextmtu;
   41         } __attribute__((packed)) ih_pmtu;
   42 
   43         struct ih_rtradv
   44         {
   45             u_int8_t irt_num_addrs;
   46             u_int8_t irt_wpa;
   47             u_int16_t irt_lifetime;
   48         } __attribute__((packed)) ih_rtradv;
   49     } __attribute__((packed)) icmp_hun;
   50 #define icmp_pptr       icmp_hun.ih_pptr
   51 #define icmp_gwaddr     icmp_hun.ih_gwaddr
   52 #define icmp_id         icmp_hun.ih_idseq.icd_id
   53 #define icmp_seq        icmp_hun.ih_idseq.icd_seq
   54 #define icmp_void       icmp_hun.ih_void
   55 #define icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
   56 #define icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
   57 #define icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
   58 #define icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
   59 #define icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
   60     union
   61     {
   62         struct
   63         {
   64             u_int32_t its_otime;
   65             u_int32_t its_rtime;
   66             u_int32_t its_ttime;
   67         } __attribute__((packed)) id_ts;
   68         struct
   69         {
   70             struct ip idi_ip;
   71             /* options and then 64 bits of data */
   72         } __attribute__((packed)) id_ip;
   73         struct icmp_ra_addr id_radv;
   74         u_int32_t   id_mask;
   75         u_int8_t    id_data[1];
   76     } __attribute__((packed)) icmp_dun;
   77 #define icmp_otime      icmp_dun.id_ts.its_otime
   78 #define icmp_rtime      icmp_dun.id_ts.its_rtime
   79 #define icmp_ttime      icmp_dun.id_ts.its_ttime
   80 #define icmp_ip         icmp_dun.id_ip.idi_ip
   81 #define icmp_radv       icmp_dun.id_radv
   82 #define icmp_mask       icmp_dun.id_mask
   83 #define icmp_data       icmp_dun.id_data
   84 } __attribute__((packed));
   85 
   86 struct icmp6_hdr {
   87     u_int8_t  icmp6_type;     /* type field */
   88     u_int8_t  icmp6_code;     /* code field */
   89     u_int16_t icmp6_cksum;    /* checksum field */
   90     union {
   91         u_int32_t icmp6_un_data32[1]; /* type-specific field */
   92         u_int16_t icmp6_un_data16[2]; /* type-specific field */
   93         u_int8_t  icmp6_un_data8[4];  /* type-specific field */
   94     } __attribute__((packed)) icmp6_dataun;
   95 } __attribute__((packed));
   96 
   97 #define icmp6_data32    icmp6_dataun.icmp6_un_data32
   98 #define icmp6_data16    icmp6_dataun.icmp6_un_data16
   99 #define icmp6_data8     icmp6_dataun.icmp6_un_data8
  100 #define icmp6_pptr      icmp6_data32[0] /* parameter prob */
  101 #define icmp6_mtu       icmp6_data32[0] /* packet too big */
  102 #define icmp6_id        icmp6_data16[0] /* echo request/reply */
  103 #define icmp6_seq       icmp6_data16[1] /* echo request/reply */
  104 #define icmp6_maxdelay  icmp6_data16[0] /* mcast group membership */
  105 
  106 #define ICMP6_ECHO_REQUEST 128 /* echo service */
  107 #define ICMP6_ECHO_REPLY   129 /* echo reply */
  108 
  109 #endif /* CYGWIN_H */