Changeset 183 for trunk/src/emx/include/net
- Timestamp:
- May 19, 2003, 4:41:00 AM (23 years ago)
- Location:
- trunk/src/emx/include/net
- Files:
-
- 3 edited
-
if.h (modified) (19 diffs, 1 prop)
-
if_arp.h (modified) (6 diffs, 1 prop)
-
route.h (modified) (8 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/net/if.h
-
Property cvs2svn:cvs-rev
changed from
1.1to1.2
r182 r183 1 1 /* Modifed for emx by hv 1994,1996 2 2 3 * 3 4 * Copyright (c) 1982, 1986, 1989 Regents of the University of California. … … 43 44 #endif 44 45 46 47 48 49 50 45 51 /* 46 52 * Structures defining a network interface, providing a packet … … 67 73 * interfaces. These routines live in the files if.c and route.c 68 74 */ 69 /* XXX fast fix for SNMP, going away soon */70 #include <sys/time.h>71 72 #ifdef TCPIPV473 #pragma pack(1)74 #else75 #pragma pack(4)76 #endif77 78 75 79 76 /* … … 82 79 * (Would like to call this struct ``if'', but C isn't PL/1.) 83 80 */ 84 /*forward*/ struct mbuf; 85 /*forward*/ struct ifaddr; 81 #pragma pack(1) 82 struct mbuf; 83 struct ifaddr; 86 84 struct ifnet { 87 85 char *if_name; /* name, e.g. ``en'' or ``lo'' */ … … 95 93 struct mbuf *ifq_head; 96 94 struct mbuf *ifq_tail; 97 #ifndef TCPIPV498 int ifq_len;99 int ifq_maxlen;100 int ifq_drops;101 #else102 95 short ifq_len; 103 96 short ifq_maxlen; 104 97 u_short ifq_drops; 105 #endif106 98 } if_snd; /* output queue */ 107 99 /* procedure handles */ … … 112 104 int (*if_watchdog)(void); /* timer routine */ 113 105 /* generic interface statistics */ 114 #ifndef TCPIPV4115 int if_ipackets; /* packets received on interface */116 int if_ierrors; /* input errors on interface */117 int if_opackets; /* packets sent on interface */118 int if_oerrors; /* output errors on interface */119 int if_collisions; /* collisions on csma interfaces */120 #else121 106 u_short if_ipackets; /* packets received on interface */ 122 107 u_short if_ierrors; /* input errors on interface */ … … 124 109 u_short if_oerrors; /* output errors on interface */ 125 110 u_short if_collisions; /* collisions on csma interfaces */ 126 #endif127 111 /* end statistics */ 128 112 struct ifnet *if_next; 129 113 114 130 115 /* the following structures are special for OS/2 TCP/IP only */ 131 116 u_char if_adapternum; /* adapter number */ … … 134 119 u_long if_speed; 135 120 136 #define IF_RTTSCALE 1000 137 u_short if_rtt; /* Est interface rtt in ms */ 138 u_short if_rttvar; /* Est interface rttvar in ms */ 139 u_short if_rttmin; /* Fixed interface rttmin in ms */ 140 u_short if_sendpipe; /* Send socket buffer/window size */ 141 u_short if_recvpipe; /* Recv socket buffer/window size */ 142 u_short if_ssthresh; /* Gateway buffer limit (slow strt) */ 143 #ifdef TCPIPV4 144 u_long if_eflags; /* Extended flags */ 145 struct ifqueue if_traceq; /* packet trace queue */ 146 u_short if_segsize; /* segment size for interface */ 147 u_short if_use576; /* use 576 or 1460 as def. mss if */ 148 /* going through a router */ 149 u_short if_rfc1469; /* using broadcast or functional */ 150 /* addr for IP Multicast */ 151 #define IFF_RFC1469_BC 1 /* use broadcast */ 152 #define IFF_RFC1469_FA 2 /* use functional address */ 153 #define IFF_RFC1469_MA 3 /* use multicast address */ 154 #endif 155 }; 156 157 #ifndef TCPIPV4 158 struct ifmib { 159 int ifNumber; /* number of network interfaces */ 160 struct iftable { 161 int ifIndex; /* index of this interface */ 162 char ifDescr[45]; /* description */ 163 int ifType; /* type of the interface */ 164 int ifMtu; /* MTU of the interface */ 165 char ifPhysAddr[6]; /* MTU of the interface */ 166 int ifOperStatus; 167 u_long ifSpeed; 168 u_long ifLastChange; 169 u_long ifInOctets; 170 u_long ifOutOctets; 171 u_long ifOutDiscards; 172 u_long ifInDiscards; 173 u_long ifInErrors; 174 u_long ifOutErrors; 175 u_long ifInUnknownProtos; 176 u_long ifInUcastPkts; 177 u_long ifOutUcastPkts; 178 u_long ifInNUcastPkts; 179 u_long ifOutNUcastPkts; 180 } iftable[20]; 181 }; 182 #else /* TCP/IP V4 */ 121 /* Interface TCP estimates/controls. Serves the same */ 122 /* purpose as the per-route values in BSD-Reno, but I didn't */ 123 /* have to touch any of the route manipulation code. */ 124 u_short if_rtt; /* Est interface rtt in ms */ 125 u_short if_rttvar; /* Est interface rttvar in ms */ 126 u_short if_rttmin; /* Fixed interface rttmin in ms */ 127 u_short if_sendpipe; /* Send socket buffer/window size */ 128 u_short if_recvpipe; /* Recv socket buffer/window size */ 129 u_short if_ssthresh; /* Gateway buffer limit (slow strt) */ 130 u_long if_eflags; /* Extended Flags */ 131 struct ifqueue if_traceq; /* packet trace queue */ 132 u_short if_segsize; /* segment size for interface*/ 133 u_short if_use576; /* use 576 or 1460 as def. mss if going thru a router */ 134 /* Token Ring IP multicast flag */ 135 u_short if_rfc1469; /* using broadcast or functional address */ 136 /* for IP Mulitcast */ 137 #define IF_RTTSCALE 1000 138 #endif /* __OS2__ */ 139 }; 140 #pragma pack() 141 #endif /*TCPV40HDRS*/ 183 142 184 143 #ifndef IFMIB_ENTRIES … … 186 145 #endif 187 146 147 148 188 149 struct ifmib { 189 150 short ifNumber; /* number of network interfaces */ … … 210 171 } iftable[IFMIB_ENTRIES]; 211 172 }; 212 #endif /* TCP/IP V4 */ 213 #pragma pack() 173 #pragma pack() 174 175 #else /*TCPV40HDRS*/ 176 177 #pragma pack(1) /* force on doubleword boundary */ 178 struct iftable { 179 short iftIndex; /* index of this interface */ 180 char iftDescr[45]; /* description */ 181 short iftType; /* type of the interface */ 182 short iftMtu; /* MTU of the interface */ 183 char iftPhysAddr[6]; /* MTU of the interface */ 184 short iftOperStatus; 185 u_long iftSpeed; 186 u_long iftLastChange; 187 u_long iftInOctets; 188 u_long iftOutOctets; 189 u_long iftOutDiscards; 190 u_long iftInDiscards; 191 u_long iftInErrors; 192 u_long iftOutErrors; 193 u_long iftInUnknownProtos; 194 u_long iftInUcastPkts; 195 u_long iftOutUcastPkts; 196 u_long iftInNUcastPkts; 197 u_long iftOutNUcastPkts; 198 }; 199 struct ifmib { 200 short ifNumber; 201 struct iftable iftable[IFMIB_ENTRIES]; 202 }; 203 #pragma pack() /* reset to default packing */ 204 205 #define IFC_ALLRTSBCAST 0x0001 206 #define IFC_802_3 0x0002 207 #define IFC_FDDI 0x0004 208 #define IFC_NOREDIR 0x0010 209 210 #define OPERSTATUS_UP 0x1 211 #define OPERSTATUS_DOWN 0x2 212 #define OPERSTATUS_TESTING 0x3 213 #endif /*TCPV40HDRS*/ 214 214 215 215 #define IFF_UP 0x1 /* interface is up */ … … 219 219 #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ 220 220 #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ 221 222 223 221 224 #define IFF_RUNNING 0x40 /* resources allocated */ 222 225 #define IFF_NOARP 0x80 /* no address resolution protocol */ 223 /* next two not supported now, but reserved: */224 226 #define IFF_PROMISC 0x100 /* receive all packets */ 225 227 #define IFF_ALLMULTI 0x200 /* receive all multicast packets */ 226 #define IFF_OACTIVE 0x400 /* transmission in progress */ 227 #define IFF_SIMPLEX 0x800 /* can't hear own transmissions */ 228 #define IFF_DEFMTU 0x400 /* default mtu of 1500 */ 229 #define IFF_MULTICAST 0x800 /* supports multicast */ 230 /* 231 * The IFF_MULTICAST flag indicates that the network can support the 232 * transmission and reception of higher-level (e.g., IP) multicast packets. 233 * It is independent of hardware support for multicasting; for example, 234 * point-to-point links or pure broadcast networks may well support 235 * higher-level multicasts. 236 */ 228 237 #define IFF_BRIDGE 0x1000 /* support token ring routine field */ 229 #define IFF_SNAP 0x2000 /* support extended S NAP header */238 #define IFF_SNAP 0x2000 /* support extended SAP header */ 230 239 #define IFF_ETHER 0x4000 /* ethernet interface */ 231 240 #define IFF_LOOPBRD 0x8000 /* ethernet interface */ 241 242 243 244 245 246 247 248 249 250 251 232 252 233 253 /*hv: flags set internally only */ 234 #ifdef BSD_TCPCOMPAT 254 #ifdef TCPV40HDRS 255 #define IFF_CANTCHANGE (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING) 256 #else 235 257 #define IFF_CANTCHANGE \ 236 258 (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE| \ 237 IFF_SIMPLEX|IFF_MULTICAST) 238 #else 239 #define IFF_CANTCHANGE (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING) 240 #endif 241 242 #ifdef TCPIPV4 259 IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI) 260 #endif 261 243 262 /* packet tracing extension */ 244 263 #define IFFE_PKTTRACE 0x00000001 /* trace datalink where possible */ 245 264 #define IFFE_IPTRACE 0x00000002 /* trace ONLY IP packets */ 246 265 266 267 268 247 269 struct pkt_trace_hdr { 248 270 u_short pt_htype; /* header type */ 249 #define HT_IP 0x01 /* IP */250 #define HT_ETHER 0x06 /* Ethernet */251 #define HT_ISO88023 0x07 /* CSMA CD */252 #define HT_ISO88025 0x09 /* Token Ring */253 #define HT_SLIP 0x1c /* Serial Line IP */254 #define HT_PPP 0x18 /* PPP IP */255 271 u_short pt_len; /* in: pt_buf len, out: packet len */ 256 272 caddr_t pt_data; /* packet ATTN: This is a _Seg16 addr! */ 257 273 u_long pt_tstamp; /* time stamp in milliseconds */ 258 274 }; 259 260 #endif /* TCP/IP V4 */ 261 275 #ifndef TCPV40HDRS 276 #pragma pack() 277 #endif 278 #define HT_IP 0x01 /* IP */ 279 #define HT_ETHER 0x06 /* Ethernet */ 280 #define HT_ISO88023 0x07 /* CSMA CD */ 281 #define HT_ISO88025 0x09 /* Token Ring */ 282 #define HT_SLIP 0x1c /* Serial Line IP */ 283 #define HT_PPP 0x18 /* PPP IP */ 284 285 #ifndef TCPV40HDRS 286 /* genric interface information */ 287 #pragma pack(1) 288 struct if_data { 289 u_char ifi_type; /* ethernet, tokenring, etc */ 290 u_char ifi_addrlen; /* media address length */ 291 u_char ifi_hdrlen; /* media header length */ 292 u_long ifi_mtu; /* maximum transmission unit */ 293 u_long ifi_metric; /* routing metric (external only) */ 294 u_long ifi_baudrate; /* linespeed */ 295 /* volatile statistics */ 296 u_long ifi_collisions; /* collisions on csma interfaces */ 297 u_long ifi_ibytes; /* total number of octets received */ 298 u_long ifi_obytes; /* total number of octets sent */ 299 u_long ifi_oqdrops; /* dropped on output, this interface */ 300 u_long ifi_iqdrops; /* dropped on input, this interface */ 301 u_long ifi_ierrors; /* input errors on interface */ 302 u_long ifi_oerrors; /* output errors on interface */ 303 u_long ifi_noproto; /* destined for unsupported protocol */ 304 u_long ifi_ipackets; /* packets received on interface */ 305 u_long ifi_opackets; /* packets sent on interface */ 306 u_long ifi_imcasts; /* packets received via multicast */ 307 u_long ifi_omcasts; /* packets sent via multicast */ 308 short ifi_OperStatus; /* SNMP Oper Status */ 309 struct timeval ifi_lastchange;/* last updated */ 310 u_char ifi_descr[45]; /* description of the interface */ 311 }; 312 #pragma pack() 313 314 /* 315 * Message format for use in obtaining information about interfaces 316 * from getkerninfo and the routing socket 317 */ 318 #pragma pack(1) 319 struct if_msghdr { 320 u_short ifm_msglen; /* to skip over non-understood messages */ 321 u_char ifm_version; /* future binary compatability */ 322 u_char ifm_type; /* message type */ 323 int ifm_addrs; /* like rtm_addrs */ 324 int ifm_flags; /* value of if_flags */ 325 u_short ifm_index; /* index for associated ifp */ 326 struct if_data ifm_data;/* statistics and other data about if */ 327 }; 328 #pragma pack() 329 330 /* 331 * Message format for use in obtaining information about interface addresses 332 * from getkerninfo and the routing socket 333 */ 334 #pragma pack(1) 335 struct ifa_msghdr { 336 u_short ifam_msglen; /* to skip over non-understood messages */ 337 u_char ifam_version; /* future binary compatability */ 338 u_char ifam_type; /* message type */ 339 int ifam_addrs; /* like rtm_addrs */ 340 int ifam_flags; /* value of ifa_flags */ 341 u_short ifam_index; /* index for associated ifp */ 342 int ifam_metric; /* value of ifa_metric */ 343 }; 344 #pragma pack() 345 #endif /*!TCPV40HDRS*/ 346 347 #ifdef TCPV40HDRS 262 348 /* 263 349 * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1) … … 284 370 (ifq)->ifq_len++;\ 285 371 } 286 #define IF_DEQUEUE(ifq, m) {\ 287 (m)=(ifq)->ifq_head;\ 288 if (m) {\ 289 if (((ifq)->ifq_head=(m)->m_act)==0)\ 290 (ifq)->ifq_tail=0;\ 291 (m)->m_act=0;\ 292 (ifq)->ifq_len--;\ 293 }\ 294 } 372 /* 373 * Packets destined for level-1 protocol input routines 374 * have a pointer to the receiving interface prepended to the data. 375 * IF_DEQUEUEIF extracts and returns this pointer when dequeueing the packet. 376 * IF_ADJ should be used otherwise to adjust for its presence. 377 */ 295 378 #define IF_ADJ(m) {\ 296 379 (m)->m_off+=sizeof(struct ifnet*);\ … … 313 396 }\ 314 397 } 398 399 400 401 402 403 404 405 406 315 407 316 408 #define IFQ_MAXLEN 50 … … 334 426 struct ifaddr *ifa_next; /* next address for interface */ 335 427 }; 428 336 429 337 430 /* … … 341 434 * remainder may be interface specific. 342 435 */ 436 437 438 343 439 struct ifreq { 344 440 #define IFNAMSIZ 16 … … 358 454 #define ifr_metric ifr_ifru.ifru_metric /* metric */ 359 455 #define ifr_data ifr_ifru.ifru_data /* for use by interface */ 360 }; 456 #ifndef TCPV40HDRS 457 #define ifr_eflags ifr_ifru.ifru_data /* Extended flags */ 458 #endif 459 }; 460 #ifndef TCPV40HDRS 461 #pragma pack() 462 #endif 463 464 #ifndef TCPV40HDRS 465 #pragma pack(1) 466 struct ifaliasreq { 467 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 468 struct sockaddr ifra_addr; 469 struct sockaddr ifra_broadaddr; 470 struct sockaddr ifra_mask; 471 }; 472 #pragma pack() 473 #endif 361 474 362 475 /* … … 366 479 * must know all networks accessible). 367 480 */ 481 482 483 368 484 struct ifconf { 369 485 int ifc_len; /* size of associated buffer */ … … 375 491 #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ 376 492 }; 493 494 495 377 496 378 497 #include <net/if_arp.h> … … 382 501 #endif 383 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 384 550 #endif /* _NET_IF_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/net/if_arp.h
-
Property cvs2svn:cvs-rev
changed from
1.1to1.2
r182 r183 1 1 /* Modified for emx by hv 1994,1996 2 2 3 * 3 4 * Copyright (c) 1986 Regents of the University of California. … … 49 50 * specified. Field names used correspond to RFC 826. 50 51 */ 52 53 54 51 55 struct arphdr { 52 56 u_short ar_hrd; /* format of hardware address */ 53 57 #define ARPHRD_ETHER 1 /* ethernet hardware address */ 54 58 #define ARPHRD_802 6 /* 802 net hardware address */ 59 60 61 55 62 u_short ar_pro; /* format of protocol address */ 56 63 u_char ar_hln; /* length of hardware address */ … … 59 66 #define ARPOP_REQUEST 1 /* request to resolve address */ 60 67 #define ARPOP_REPLY 2 /* response to previous request */ 68 69 70 71 72 73 74 61 75 #define REVARP_REQUEST 3 /* reverse ARP request (not IBM) */ 62 76 #define REVARP_REPLY 4 /* reverse ARP reply (not IBM) */ 77 63 78 /* 64 79 * The remaining fields are variable in size, … … 70 85 /* u_char ar_tpa[]; * target protocol address */ 71 86 }; 87 88 89 72 90 73 91 /* 74 92 * ARP ioctl request 75 93 */ 94 95 96 76 97 struct arpreq { 77 98 struct sockaddr arp_pa; /* protocol address */ … … 79 100 int arp_flags; /* flags */ 80 101 }; 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 81 121 /* arp_flags and at_flags field values */ 82 122 #define ATF_INUSE 0x01 /* entry in use */ … … 85 125 #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ 86 126 #define ATF_USETRAILERS 0x10 /* has requested trailers */ 127 128 129 87 130 88 131 #endif /* !_NET_IF_ARP_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/net/route.h
-
Property cvs2svn:cvs-rev
changed from
1.1to1.2
r182 r183 1 1 /* Modified for emx by hv and em 1994,1996 2 * 2 * Modified for gcc/os2 by bird 2003 3 * 3 4 * Copyright (c) 1980, 1986 Regents of the University of California. 4 5 * All rights reserved. … … 47 48 /* 48 49 * Kernel resident routing tables. 49 * 50 * 50 51 * The routing tables are initialized when interface addresses 51 52 * are set by making entries for all directly connected interfaces. … … 62 63 }; 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 64 85 /* 65 86 * rmx_rtt and rmx_rttvar are stored as microseconds; … … 69 90 #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ 70 91 #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) 92 93 71 94 72 95 /* … … 80 103 * Following structure necessary for 4.3 compatibility; 81 104 */ 82 struct rtentry { 105 #pragma pack(1) 106 #ifdef TCPV40HDRS 107 struct rtentry 108 #else 109 struct ortentry 110 #endif 111 { 83 112 u_long rt_hash; /* to speed lookups */ 84 113 struct sockaddr rt_dst; /* key */ … … 90 119 long metric1,metric2,metric3,metric4; /*IBM special */ 91 120 }; 92 93 #define RTF_UP 0x1 /* route useable */ 121 #pragma pack() 122 123 /* IBM: hv: I think this is the internal structure of the RT table of the 124 * router daemon. Don't think it belongs here, but the toolkit has it as well 125 */ 126 #define RTENTRY_COUNT 512 127 #pragma pack(1) 128 struct rtentries { 129 short hostcount; 130 short netcount; 131 #ifdef TCPV40HDRS 132 struct rtentry rttable[RTENTRY_COUNT]; 133 #else 134 struct ortentry rttable[RTENTRY_COUNT]; 135 #endif 136 }; 137 #pragma pack() 138 139 140 #define RTF_UP 0x1 /* route usable */ 94 141 #define RTF_GATEWAY 0x2 /* destination is a gateway */ 95 142 #define RTF_HOST 0x4 /* host entry (net otherwise) */ … … 104 151 #define RTF_STATIC 0x800 /* route manually added */ 105 152 #define RTF_BLACKHOLE 0x1000 /* discard packets during updates */ 153 154 155 106 156 #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ 107 157 #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ 158 159 160 161 162 163 164 165 166 167 108 168 109 169 … … 118 178 short rts_wildcard; /* lookups satisfied by a wildcard */ 119 179 }; 180 120 181 /* 121 182 * Structures for routing messages. 122 183 */ 123 # ifndef __EMX__184 # 124 185 struct rt_msghdr { 125 u_short rtm_msglen; /* to skip over non-understood messages */ 126 u_char rtm_version; /* future binary compatability */ 127 u_char rtm_type; /* message type */ 128 u_short rtm_index; /* index for associated ifp */ 129 pid_t rtm_pid; /* identify sender */ 130 int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 131 int rtm_seq; /* for sender to identify action */ 132 int rtm_errno; /* why failed */ 133 int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 134 int rtm_use; /* from rtentry */ 135 u_long rtm_inits; /* which metrics we are initializing */ 136 struct rt_metrics rtm_rmx; /* metrics themselves */ 186 #define IFNAMSIZ 16 187 u_short rtm_msglen; /* to skip over non-understood messages */ 188 u_char rtm_version; /* future binary compatibility */ 189 u_char rtm_type; /* message type */ 190 u_short rtm_index; /* index for associated ifp */ 191 short rtm_unit; /* new field for subnet routing */ 192 int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 193 int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 194 pid_t rtm_pid; /* identify sender */ 195 int rtm_seq; /* for sender to identify action */ 196 int rtm_errno; /* why failed */ 197 int rtm_use; /* from rtentry */ 198 u_long rtm_inits; /* which metrics we are initializing */ 199 u_long rtm_netmask; /* new field for subnet routing */ 200 char rtm_name[IFNAMSIZ]; /* new field for subnet routing */ 201 struct rt_metrics rtm_rmx; /* metrics themselves */ 202 }; 203 #pragma pack() 204 205 #define RTM_VERSION 4 /* Up the ante and ignore older versions */ 206 207 #define RTM_ADD 0x1 /* Add Route */ 208 #define RTM_DELETE 0x2 /* Delete Route */ 209 #define RTM_CHANGE 0x3 /* Change Metrics or flags */ 210 #define RTM_GET 0x4 /* Report Metrics */ 211 #define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ 212 #define RTM_REDIRECT 0x6 /* Told to use different route */ 213 #define RTM_MISS 0x7 /* Lookup failed on this address */ 214 #define RTM_LOCK 0x8 /* fix specified metrics */ 215 #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ 216 #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ 217 #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ 218 #define RTM_NEWADDR 0xc /* address being added to iface */ 219 #define RTM_DELADDR 0xd /* address being removed from iface */ 220 #define RTM_IFINFO 0xe /* iface going up/down etc. */ 221 222 #define RTV_MTU 0x1 /* init or lock _mtu */ 223 #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ 224 #define RTV_EXPIRE 0x4 /* init or lock _hopcount */ 225 #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ 226 #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ 227 #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ 228 #define RTV_RTT 0x40 /* init or lock _rtt */ 229 #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ 230 231 /* 232 * Bitmask values for rtm_addr. 233 */ 234 #define RTA_DST 0x1 /* destination sockaddr present */ 235 #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ 236 #define RTA_NETMASK 0x4 /* netmask sockaddr present */ 237 #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ 238 #define RTA_IFP 0x10 /* interface name sockaddr present */ 239 #define RTA_IFA 0x20 /* interface addr sockaddr present */ 240 #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ 241 #define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ 242 243 /* 244 * Index offsets for sockaddr array for alternate internal encoding. 245 */ 246 #define RTAX_DST 0 /* destination sockaddr present */ 247 #define RTAX_GATEWAY 1 /* gateway sockaddr present */ 248 #define RTAX_NETMASK 2 /* netmask sockaddr present */ 249 #define RTAX_GENMASK 3 /* cloning mask sockaddr present */ 250 #define RTAX_IFP 4 /* interface name sockaddr present */ 251 #define RTAX_IFA 5 /* interface addr sockaddr present */ 252 #define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ 253 #define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ 254 #define RTAX_MAX 8 /* size of array to allocate */ 255 256 struct rt_addrinfo { 257 int rti_addrs; 258 struct sockaddr *rti_info[RTAX_MAX]; 137 259 }; 138 260 139 261 struct route_cb { 140 int ip_count; 141 int ns_count; 142 int iso_count; 143 int any_count; 144 }; 145 #define RTM_VERSION 2 /* Up the ante and ignore older versions */ 146 147 #define RTM_ADD 0x1 /* Add Route */ 148 #define RTM_DELETE 0x2 /* Delete Route */ 149 #define RTM_CHANGE 0x3 /* Change Metrics or flags */ 150 #define RTM_GET 0x4 /* Report Metrics */ 151 #define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ 152 #define RTM_REDIRECT 0x6 /* Told to use different route */ 153 #define RTM_MISS 0x7 /* Lookup failed on this address */ 154 #define RTM_LOCK 0x8 /* fix specified metrics */ 155 #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ 156 #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ 157 #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ 158 159 #define RTV_MTU 0x1 /* init or lock _mtu */ 160 #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ 161 #define RTV_EXPIRE 0x4 /* init or lock _hopcount */ 162 #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ 163 #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ 164 #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ 165 #define RTV_RTT 0x40 /* init or lock _rtt */ 166 #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ 167 168 #define RTA_DST 0x1 /* destination sockaddr present */ 169 #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ 170 #define RTA_NETMASK 0x4 /* netmask sockaddr present */ 171 #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ 172 #define RTA_IFP 0x10 /* interface name sockaddr present */ 173 #define RTA_IFA 0x20 /* interface addr sockaddr present */ 174 #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ 175 #endif 176 177 /* IBM: hv: I think this is the internal structure of the RT table of the 178 * router daemon. Don't think it belongs here, but the toolkit has it as well 179 */ 180 #define RTENTRY_COUNT 512 181 struct rtentries { 182 short hostcount; 183 short netcount; 184 struct rtentry rttable[RTENTRY_COUNT]; 185 }; 262 int ip_count; 263 int ns_count; 264 int iso_count; 265 int any_count; 266 }; 267 #endif /* !TCPV40HDRS */ 186 268 187 269 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
